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);
                $('div')         finds all divs
$('div:hidden')  finds only hidden divs
$('div:visible') finds only visible divs
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With