简体   繁体   中英

Detect when <iframe> parent element changes from hidden to shown

How can I detect when an iframe is shown from hidden element ?

HTML :

<div style="display:none">
 <iframe></iframe>
</div>

So when I show the <div> by jQuery via $('div').show(); , How can I detect and reload this iframe ?

PS : Detection should happen inside an iframe file.

NOT : $('div').show(function(){//do something}); or this ? (NOW I NOT SURE)

$('div').show("slow",function(){
  var iframe = $(this).find("iframe");
   iframe.attr('src', "SOME_URL");
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM