I want to check if any parent div have scroll bar in jQuery but I can't find any good example. Here is my code:-
<div>
<div class="heading">
<div class="visitor_profile">
<div class="visitor_input_con">
</div>
</div>
</div>
</div>
I want to check if any parent of .visitor_input_con
has scroll bar here is my jquery code:-
(function($) {
$.fn.hasScrollBar = function() {
return this.get(0).scrollHeight > this.height();
}
})(jQuery);
$('.visitor_input_con').hasScrollBar();
Please help me to solve this issue. Thanks