Jul 28

OffsetHeight property returns the elements real width including borders, margin and padding.
This is a IE introduced property not in w3c but now implemented in almost all browsers. Maybe we should try using mootools new get calculated width/height?

We combined this with phatfusions validate to only validate visible fields on forms.

Element.implement(
{	isHidden: function()
{	var w = this.offsetWidth, h = this.offsetHeight,
force = (this.tagName === 'TR');
return (w===0 && h===0 && !force) ? true : (w!==0 && h!==0 && !force) ? false : this.getStyle('display') === 'none';
},

isVisible: function()
{	return !this.isHidden();
}
});

2 Responses to “Check if an element’s hidden or visible using mootools”

  1. Podsluchy Says:

    Your posting is top notch.Will bookmark your website for further visits,Moreover,where did you get this awesome design for your blog?

  2. small business voip phones Says:

    Thank you for sharing excellent information. Your website is so cool. I am impressed by the details that you?ve on this site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles.

Leave a Reply