Skip to content

Instantly share code, notes, and snippets.

View hlawuleka's full-sized avatar
🏠
Working from home

Hlawuleka hlawuleka

🏠
Working from home
View GitHub Profile
@hlawuleka
hlawuleka / isItScrollableWithoutVisibleScrollbars.js
Created December 17, 2017 17:35 — forked from jlbruno/isItScrollableWithoutVisibleScrollbars.js
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) {
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) {