开发者

want to delay closing of fancybox window

开发者 https://www.devze.com 2023-01-10 01:09 出处:网络
I want to automatically close a fancybox iframe, but I want to give it a delay. $(document).ready(function() {

I want to automatically close a fancybox iframe, but I want to give it a delay.

$(document).ready(function() {
 parent.$.fancybox.close();
});

The code above will automatically close the window successfully, but I want to add a delay, so they may read the message the page displays before it au开发者_如何转开发to closes for them.


You can use setTimeout:

setTimeout("parent.$.fancybox.close()", 1000);


If you are using jquery 1.4 try the delay() function:

parent.$.fancybox.delay(2000).close();

0

精彩评论

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

关注公众号