Snippet

JQuery voir si l'élément est visible

3 réponses de la communauté

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

if($('#yourDiv').is(':visible')){
	//do stuff in here
}
//or
$('#yourDiv:visible').callYourFunction();
.is(':visible')
//Selects all elements that are visible.

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

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