Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save khamer/1100151 to your computer and use it in GitHub Desktop.
Save khamer/1100151 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.
function isItScrollableWithoutVisibleScrollbars(e) {return e&&(e.scrollHeight>e.offsetHeight)&&!(e.offsetWidth>e.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