Created
July 22, 2011 18:54
Revisions
-
jlbruno created this gist
Jul 22, 2011 .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,18 @@ var isItScrollableWithoutVisibleScrollbars = function(el) { if (el === null) { return false; } var isScrollable = false; var hasScrollbars = false; // first, lets find out if it has scrollable content isScrollable = el.scrollHeight > el.offsetHeight ? true : false; // if it's scrollable, let's see if it likely has scrollbars if (isScrollable) { hasScrollbars = (el.offsetWidth > el.scrollWidth) ? true : false; } if (isScrollable && !hasScrollbars) { return true; } else { return false; } }; 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,5 @@ // example usage if ( isItScrollableWithoutVisibleScrollbars(plwrap) ) { playlistScroll = new iScroll('playlist'); }