I need to find a way to include hidden divs in the each
statement below. I can't seem to find the answer. It's not just for children of a hidden element so i'm not able to write it based on display:none
$("div").each(function(){
if ($(this).hasScrollBar()){
$(this).addClass('scrollable');
}
});
hasScrollBar Function:
(function($) {
$.fn.hasScrollBar = function() {
return this.get(0).scrollHeight > this.innerHeight();
}
})(jQuery);