jeffturcotte
7/22/2011 - 7:02 PM

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 im

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');
}