if element is visible jquery code example

Example 1: CHECK IF element is hidden jquery

// Checks CSS content for display:[none|block], ignores visibility:[true|false]
$(element).is(":visible");

// The same works with hidden
$(element).is(":hidden");

Example 2: check if element is visible

.is(':visible')
//Selects all elements that are visible.

if($('#Div').is(':visible')){
	// add whatever code you want to run here.
}

$('#yourDiv:visible').callYourFunction();

Example 3: jquery is element hidden

// Checks css for display:[none|block], ignores visibility:[true|false]
$(element).is(":hidden");

Example 4: jquery if is visible

$('.eipC:visible').length 

//or

$('.eipC').is(':visible').length