I'm trying to find a jQuery example that checks if any parent div has a scroll bar, but I can't seem to locate a helpful one. Here is the code snippet I am working with:
<div>
<div class="heading">
<div class="visitor_profile">
<div class="visitor_input_con">
</div>
</div>
</div>
</div>
I am specifically looking to check if any parent of .visitor_input_con
has a scroll bar using this jQuery code:
(function($) {
$.fn.hasScrollBar = function() {
return this.get(0).scrollHeight > this.height();
}
})(jQuery);
$('.visitor_input_con').hasScrollBar();
If anyone could help me resolve this issue, I would greatly appreciate it. Thank you.