Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jeffturcotte/1100144 to your computer and use it in GitHub Desktop.
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.
var isItScrollableWithoutVisibleScrollbars = function(el) {
return (el && (el.scrollHeight > el.offsetHeight) && !(el.offsetWidth > el.scrollWidth));
};
// 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