gpt4 book ai didi

javascript - 30 秒后显示 Jquery UI 对话框

转载 作者:行者123 更新时间:2023-11-30 17:46:42 24 4
gpt4 key购买 nike

我有一个 jquery 对话框,我想在用户进入该页面后 30 秒弹出它。

我的对话框代码是:

    <script>
$(function() {
$("#dialog).dialog(
{
width: "300",
height: "280",
modal: true,

resizable: false,
closeOnEscape: true ,
open: function(){
jQuery('.ui-widget-overlay, #dialog-survey').bind('click',function(){
jQuery('#dialog').dialog('close');
})
}
});

$(".ui-dialog-titlebar").hide()

$(".survey_link").bind("click", function() {

var now = new Date();
var time = now.getTime();
time += 3600 * 1000;
now.setTime(time);


document.cookie='CLK=YES;expires=' + now.toUTCString() + ';path=/';
});
});
</script>

我看过有关如何在 X 秒后关闭的代码,并尝试使用它使对话框在 x 秒后打开,但没成功。我需要什么?谢谢!

最佳答案

$(document).ready(function(){ 
setTimeout(function(){
$("#dialog").dialog("open");
}, 30000);
};

关于javascript - 30 秒后显示 Jquery UI 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20003994/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com