<small id='1o0tD'></small><noframes id='1o0tD'>

        <bdo id='1o0tD'></bdo><ul id='1o0tD'></ul>

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

        <tfoot id='1o0tD'></tfoot>

        <legend id='1o0tD'><style id='1o0tD'><dir id='1o0tD'><q id='1o0tD'></q></dir></style></legend>

        如何在我的 introjs 中为下一步触发模态?

        How do I fire a modal for the next step in my introjs?(如何在我的 introjs 中为下一步触发模态?)
          • <tfoot id='xRgiH'></tfoot><legend id='xRgiH'><style id='xRgiH'><dir id='xRgiH'><q id='xRgiH'></q></dir></style></legend>
              <tbody id='xRgiH'></tbody>
            <i id='xRgiH'><tr id='xRgiH'><dt id='xRgiH'><q id='xRgiH'><span id='xRgiH'><b id='xRgiH'><form id='xRgiH'><ins id='xRgiH'></ins><ul id='xRgiH'></ul><sub id='xRgiH'></sub></form><legend id='xRgiH'></legend><bdo id='xRgiH'><pre id='xRgiH'><center id='xRgiH'></center></pre></bdo></b><th id='xRgiH'></th></span></q></dt></tr></i><div id='xRgiH'><tfoot id='xRgiH'></tfoot><dl id='xRgiH'><fieldset id='xRgiH'></fieldset></dl></div>
              <bdo id='xRgiH'></bdo><ul id='xRgiH'></ul>

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

                  本文介绍了如何在我的 introjs 中为下一步触发模态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  所以 IntroJS 使用 data-introdata-step 属性.

                  例如,我的徽标如下所示:

                  <h1 id="logo" data-step="1" data-intro="欢迎来到MyApp,在这里您可以开始为世代创建相册!让我们帮助您开始.">

                  但是对于第 3 步,它是在按下时在一个元素上,下一步应该在第 3 步中的元素被按下时出现的模式上.

                  我将这个作为我的 Step 4 不起作用:

                  <div class="popup" id="add-images-step-1" data-step="4" data-intro="GETS TO UPLOADING">

                  现在,当您到达 Step 3 并按 next 时,它会给您一个屏幕外的空白框.

                  如何让它专注于那个模式?

                  解决方案

                  我们可以通过方法 onchange() (

                  So IntroJS works off of the data-intro and data-step attributes.

                  So for instance my logo looks like this:

                  <h1 id="logo" data-step="1" data-intro="Welcome to MyApp, where you can start creating an album for generations! Let us help you get started.">
                  

                  But for step 3 it is on an element that when pressed, the next step should be on the modal that would appear if the element in Step 3 was pressed.

                  I have this as my Step 4 which doesn't work:

                  <div class="popup" id="add-images-step-1" data-step="4" data-intro="GETS TO UPLOADING">
                  

                  Right now, when you reach Step 3 and press next, it gives you an empty white box that is off-screen.

                  How do I get it to focus on that modal?

                  解决方案

                  We can monitor changing of steps in introJs with method onchange() (monitor steps on onchange event). On entering step 4 we should show the modal, and on entering all other steps we should hide it (cause user can use non-linear navigation and e.g. can go from step 4 to step 1). Also we should hide modal on oncomplete and exit events.

                  startIntroButton.on('click', function() {
                      var introJsStarted = introJs().start();
                      // hiding modal on 'oncomplete' and 'exit' events
                      introJsStarted
                      .oncomplete(function() { $('#add-images-popup').hide();
                      }).onexit(function(){ $('#add-images-popup').hide();
                      }).onchange(function(targetElement) {
                          // and show modal on Step 4
                          if($(targetElement).attr("data-step") == 4) {
                              $('#add-images-popup').show();
                          }   
                          // don't forget to hide modal on other steps
                          if($(targetElement).attr("data-step") != 4) {
                              $('#add-images-popup').hide();
                          }
                      });
                  });
                  

                  You should place Step 4's data- attributes on the part of the modal which is actually for displaying popup window and not for hiding content of the page otherwise introJs would highlight all the window of your browser.

                    <div id="add-images-popup" class="modal" data-backdrop="static">
                          <div class="modal-dialog">
                              <div class="modal-content" data-step="4" data-intro="GETS TO UPLOADING">
                                  <div class="modal-header">...
                  

                  Intro of popup window would look this way:

                  Here is working fiddle

                  这篇关于如何在我的 introjs 中为下一步触发模态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)
                  How to show a running progress bar while page is loading(如何在页面加载时显示正在运行的进度条)

                  <i id='EhxlS'><tr id='EhxlS'><dt id='EhxlS'><q id='EhxlS'><span id='EhxlS'><b id='EhxlS'><form id='EhxlS'><ins id='EhxlS'></ins><ul id='EhxlS'></ul><sub id='EhxlS'></sub></form><legend id='EhxlS'></legend><bdo id='EhxlS'><pre id='EhxlS'><center id='EhxlS'></center></pre></bdo></b><th id='EhxlS'></th></span></q></dt></tr></i><div id='EhxlS'><tfoot id='EhxlS'></tfoot><dl id='EhxlS'><fieldset id='EhxlS'></fieldset></dl></div>
                        <tbody id='EhxlS'></tbody>
                        1. <legend id='EhxlS'><style id='EhxlS'><dir id='EhxlS'><q id='EhxlS'></q></dir></style></legend>
                          <tfoot id='EhxlS'></tfoot>

                          • <bdo id='EhxlS'></bdo><ul id='EhxlS'></ul>

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