Javascript timer to close
I have th开发者_如何学Ce following code that closes an iframe footer pop-up I have.
<a href="javascript:void(0)" onclick="parent.adpHide('footer')" class='close'>
<img alt='' src="images/close.png" /></a>
That works fine, what I'm wanting though is to set a timer that after 5 seconds closes footer. Any suggestions?
setTimeout(function() { parent.adpHide('footer') }, 5000)
Change your onclick
to:
setTimeout( function() { parent.adpHide('footer'); }, 5000 );
精彩评论