check if a div is visible jquery code example
Example 1: CHECK IF element is hidden jquery
$(element).is(":visible");
$(element).is(":hidden");
Example 2: jquery see if element is visible
.is(':visible')
if($('#yourDiv').is(':visible')){
}
$('#yourDiv:visible').callYourFunction();
Example 3: jquery if is visible
$('.eipC:visible').length
$('.eipC').is(':visible').length
Example 4: how to detect a section is visible in jquery
$.fn.isInViewport = function() {var elementTop = $(this).offset().top;var elementBottom = elementTop + $(this).outerHeight();var viewportTop = $(window).scrollTop();var viewportBottom = viewportTop + $(window).height();return elementBottom > viewportTop && elementTop < viewportBottom;};