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();
}
});