<small id='mt1K9'></small><noframes id='mt1K9'>

<legend id='mt1K9'><style id='mt1K9'><dir id='mt1K9'><q id='mt1K9'></q></dir></style></legend>

      <tfoot id='mt1K9'></tfoot>
      <i id='mt1K9'><tr id='mt1K9'><dt id='mt1K9'><q id='mt1K9'><span id='mt1K9'><b id='mt1K9'><form id='mt1K9'><ins id='mt1K9'></ins><ul id='mt1K9'></ul><sub id='mt1K9'></sub></form><legend id='mt1K9'></legend><bdo id='mt1K9'><pre id='mt1K9'><center id='mt1K9'></center></pre></bdo></b><th id='mt1K9'></th></span></q></dt></tr></i><div id='mt1K9'><tfoot id='mt1K9'></tfoot><dl id='mt1K9'><fieldset id='mt1K9'></fieldset></dl></div>

        • <bdo id='mt1K9'></bdo><ul id='mt1K9'></ul>
      1. 引导模式在 4 秒或用户点击后关闭

        bootstrap modal close after 4 seconds or user click(引导模式在 4 秒或用户点击后关闭)

          • <i id='oG69v'><tr id='oG69v'><dt id='oG69v'><q id='oG69v'><span id='oG69v'><b id='oG69v'><form id='oG69v'><ins id='oG69v'></ins><ul id='oG69v'></ul><sub id='oG69v'></sub></form><legend id='oG69v'></legend><bdo id='oG69v'><pre id='oG69v'><center id='oG69v'></center></pre></bdo></b><th id='oG69v'></th></span></q></dt></tr></i><div id='oG69v'><tfoot id='oG69v'></tfoot><dl id='oG69v'><fieldset id='oG69v'></fieldset></dl></div>

              <bdo id='oG69v'></bdo><ul id='oG69v'></ul>
              <tfoot id='oG69v'></tfoot>

                  <tbody id='oG69v'></tbody>

                <legend id='oG69v'><style id='oG69v'><dir id='oG69v'><q id='oG69v'></q></dir></style></legend>

                  <small id='oG69v'></small><noframes id='oG69v'>

                  本文介绍了引导模式在 4 秒或用户点击后关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何为引导模式设置超时?在获取 ajax 数据后,php 返回的消息包含术语 success,我想给用户关闭窗口的选项.但是,我也只想倒计时 4 秒.目前,成功消息返回的第二个模态隐藏自身.

                  How would I set a timeout for a bootstrap modal? After getting the ajax data back that the message returned by php contains the term success, I want to give the user the option to close the window. However, I also just want to have a 4 second count down. Currently the second the success message comes back the modal hides itself.

                  $('#forgotform').submit(function (e) {
                      "use strict";
                      e.preventDefault();
                      $('#forgotsubmit').button('loading');
                      var post = $('#forgotform').serialize();
                      var action = $('#forgotform').attr('action');
                      $("#message").slideUp(350, function () {
                          $('#message').hide();
                          $.post(action, post, function (data) {
                              $('#message').html(data);
                              document.getElementById('message').innerHTML = data;
                              $('#message').slideDown('slow');
                              $('#usernamemail').focus();
                              if (data.match('success') !== null) {
                                  $('#forgotform').slideUp('slow');
                                  $('#forgotsubmit').button('complete');
                                  $('#forgotsubmit').click(function (eb) {
                                      eb.preventDefault();
                                      $('#forgot-form').modal('hide');
                                  });
                                  setTimeout($('#forgot-form').modal('hide'), 10000);
                              } else {
                                  $('#forgotsubmit').button('reset');
                              }
                          });
                      });
                  });
                  

                  推荐答案

                  调用 setTimeout() 时,将命令包装在匿名函数中.否则命令将立即执行.

                  When calling setTimeout(), wrap your command in an anonymous function. Otherwise the command will be executed immediately.

                  setTimeout(function() {$('#forgot-form').modal('hide');}, 4000);
                  

                  这篇关于引导模式在 4 秒或用户点击后关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)
                  How to show a running progress bar while page is loading(如何在页面加载时显示正在运行的进度条)
                  HTML5 Canvas toDataURL returns blank(HTML5 Canvas toDataURL 返回空白)
                  Bootstrap 3 / showing modal doesn#39;t work with the javascript way(Bootstrap 3/显示模式不适用于javascript方式)
                  How to scroll to an element within a modal using jquery?(如何使用 jquery 滚动到模式中的元素?)
                  changing size of nyromodal window(改变 nyromodal 窗口的大小)
                    <bdo id='jy4SO'></bdo><ul id='jy4SO'></ul>

                    <tfoot id='jy4SO'></tfoot>
                    <i id='jy4SO'><tr id='jy4SO'><dt id='jy4SO'><q id='jy4SO'><span id='jy4SO'><b id='jy4SO'><form id='jy4SO'><ins id='jy4SO'></ins><ul id='jy4SO'></ul><sub id='jy4SO'></sub></form><legend id='jy4SO'></legend><bdo id='jy4SO'><pre id='jy4SO'><center id='jy4SO'></center></pre></bdo></b><th id='jy4SO'></th></span></q></dt></tr></i><div id='jy4SO'><tfoot id='jy4SO'></tfoot><dl id='jy4SO'><fieldset id='jy4SO'></fieldset></dl></div>

                        <small id='jy4SO'></small><noframes id='jy4SO'>

                            <tbody id='jy4SO'></tbody>

                            <legend id='jy4SO'><style id='jy4SO'><dir id='jy4SO'><q id='jy4SO'></q></dir></style></legend>