Created
March 3, 2009 14:34
Revisions
-
cheeaun revised this gist
Jun 29, 2009 . 1 changed file with 7 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,19 @@ /* * Inspired from http://github.com/jeresig/sizzle/commit/7631f9c3f85e5fa72ac51532399cb593c2cdc71f * and this http://github.com/jeresig/sizzle/commit/5716360040a440041da19823964f96d025ca734b * and then http://dev.jquery.com/ticket/4512 */ Element.implement({ isHidden: function(){ var w = this.offsetWidth, h = this.offsetHeight, force = /^tr$/i.test(this.tagName); return (w===0 && h===0 && !force) ? true : (w!==0 && h!==0 && !force) ? false : this.getStyle('display') === 'none'; }, isVisible: function(){ return !this.isHidden(); } }); -
cheeaun revised this gist
May 18, 2009 . 1 changed file with 17 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,18 @@ /* * Inspired from http://github.com/jeresig/sizzle/commit/7631f9c3f85e5fa72ac51532399cb593c2cdc71f * and this http://github.com/jeresig/sizzle/commit/5716360040a440041da19823964f96d025ca734b */ Element.implement({ isVisible: function(){ var w = this.offsetWidth, h = this.offsetHeight; return (w===0 && h===0) ? false : (w>0 && h>0) ? true : this.getStyle('display') !== 'none'; }, isHidden: function(){ var w = this.offsetWidth, h = this.offsetHeight; return (w===0 && h===0) ? true : (w!==0 && h!==0) ? false : this.getStyle('display') === 'none'; } }); -
cheeaun created this gist
Mar 3, 2009 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ /* * Inspired from http://github.com/jeresig/sizzle/commit/7631f9c3f85e5fa72ac51532399cb593c2cdc71f */ Element.implement({ isVisible: function(){ return elem.offsetWidth > 0 || elem.offsetHeight > 0; }, isHidden: function(){ return elem.offsetWidth === 0 || elem.offsetHeight === 0; } });