admin管理员组文章数量:1432643
I am working on some website , i have used jQuery UI , for pop-up dialog .
I want to close that after 10sec, I have used fadOut 10000 ms but its slowly fades.
Here is the link
View the source code and please help me in this.
I am working on some website , i have used jQuery UI , for pop-up dialog .
I want to close that after 10sec, I have used fadOut 10000 ms but its slowly fades.
Here is the link
View the source code and please help me in this.
Share Improve this question edited Sep 3, 2009 at 10:56 Steve Harrison 126k17 gold badges89 silver badges73 bronze badges asked Sep 3, 2009 at 10:54 Wasim ShaikhWasim Shaikh 7,04018 gold badges63 silver badges88 bronze badges 1- 1 try to reduce it to an example html + javascript you can include in your question. This will increase the chances of not getting your question closed. – Davy Landman Commented Sep 3, 2009 at 10:57
2 Answers
Reset to default 5Keith's version is a good approach, another, maybe more hacky way, of doing it is this:
$("#modal").animate({opacity:1}, 10000, function() {
$(this).fadeOut();
});
This way, you can link up everything that needs to be done to the modal in one line...
There is a javascript function that allows you to carry out an action after a timeout:
setTimeout('$("#dialog").hide()', 10000);
Usually you're better off passing a function rather than the text to eval()
setTimeout(hideDialog, 10000);
function hideDialog() { $('#dialog').hide(); }
Or, if you want just one line:
setTimeout(function() { $('#dialog').hide(); }, 10000);
本文标签: javascriptPopup Dialog Hide after 10secStack Overflow
版权声明:本文标题:javascript - Popup Dialog Hide after 10sec - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745551554a2662965.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论