开发者

Javascript timer to close

开发者 https://www.devze.com 2022-12-16 05:35 出处:网络
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\'>

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 );
0

精彩评论

暂无评论...
验证码 换一张
取 消