开发者

Automatically close an iframe

I开发者_开发问答 am currently using FancyBox (http://fancybox.net/) to display a page on my website. It works amazing and as it should but I want it to close automatically as soon as X number of seconds pass. Is there a way I can do that?


Javascript

setTimeout("$.fancybox.close();", 5000); // 5000 milliseconds = 5 seconds

Code to add to your FancyBox options

onComplete: function() { setTimeout("$.fancybox.close();", 5000); }

Example

$("SELECTOR").fancybox({
    'type': 'iframe',
    onComplete: function() { setTimeout("$.fancybox.close();", 5000); }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜