开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜