vonhact vonhact -3 years ago 119
jQuery Question

jQuery do something when element is shown

I want my code to execute when an element is shown.

$('.test').on('click', function(){
$('.sub-slider').on('show', function(){

Answer Source

Try this:

var visible = $("#ele"/*select the element*/).is(":visible");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="ele"></div>

You can delete the div to test it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download