My problem is that I need a property or something to be able to know if an element (div) is visible in the scroll window and in the same way is not hidden
My problem is that I need a property or something to be able to know if an element (div) is visible in the scroll window and in the same way is not hidden
Being 'testdiv' the element you want to consult you can check its visibility from javascript using:
document.getElementById('testdiv').style.visibility.
Greetings.
Check that your div has a id
or a class
and do this check (you need javascript)
<div id="contenedor"></div>
<script type="text/javascript">
if ($("div#contenedor").css('display') == 'none' ||
$("div#contenedor").css("visibility") == "hidden"){
// El div no se muestra en pantalla
} else {
// El div se muestra en pantalla
}
</script>
With class
it would be the same but with a period - div.contenedor