Bootstrap Modal,iFrame和Smart Wizard表单

时间:2013-08-14 19:34:14

标签: twitter-bootstrap modal-dialog smart-wizard

我正试图通过iframe从bootstrap模式启动一个smartwizard表单,我遇到了表单第一页的问题。模态打开正确,但表单的第1步尚未打开。如果单击下一步出现步骤2,您可以再次返回步骤1,但为什么不在启动时执行此操作?

我正在创建一个工作站点,他们目前正在使用ei7 - 所以这可能是特定于iFrame / Explorer 7的。

我在下面创建了一个简单的页面作为测试。

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Modal Test</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet">
    <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://getbootstrap.com/2.3.2/assets/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="http://getbootstrap.com/2.3.2/assets/ico/favicon.png">
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Testing Modal</a>
          <div class="nav-collapse collapse">

          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">

       <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a><!-- Modal -->

      <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width:1018px; height:700px; top:50px; margin-left:-40%; "> 
       <div class="modal-header" >   
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>  
        <iframe src="http://techlaboratory.net/techlab/demos/SmartWizard2/index.htm" width="100%" height="100%" frameborder="0" style="top:-20px; left:-16px; width:1020px;  position:relative; margin-top:-40px; margin-bottom:-40px;"></iframe>

       </div>  <div class="modal-footer">  

       <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>    </div></div>


    <script>

    </script>



    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://getbootstrap.com/2.3.2/assets/js/jquery.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-transition.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-alert.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-modal.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-dropdown.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-scrollspy.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tab.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tooltip.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-popover.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-button.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-collapse.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-carousel.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-typeahead.js"></script>

  </body>
</html>

1 个答案:

答案 0 :(得分:0)

解决。

我决定放弃iframe并将智能向导表单直接编码到模态中但我遇到了同样的问题。

在玩了一下之后我发现bootstrap需要最新的jquery所以我用智能向导代码用http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js和iframe方法替换了“js / jquery-1.4.2.min.js”的工作原理。