Forked from jlbruno/isItScrollableWithoutVisibleScrollbars.js
Created
July 22, 2011 19:02
-
-
Save jeffturcotte/1100144 to your computer and use it in GitHub Desktop.
a function to check if a certain element is scrollable, but is NOT showing scrollbars. Useful to use as a test for when you might want to implement another scrolling solution, such as iScroll for iPad.
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 characters
var isItScrollableWithoutVisibleScrollbars = function(el) { | |
return (el && (el.scrollHeight > el.offsetHeight) && !(el.offsetWidth > el.scrollWidth)); | |
}; |
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 characters
// example usage | |
if ( isItScrollableWithoutVisibleScrollbars(plwrap) ) { | |
playlistScroll = new iScroll('playlist'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment