繁体   English   中英

30秒后显示“ jQuery UI”对话框

[英]Display Jquery UI dialog after 30 seconds

我有一个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);
};

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM