繁体   English   中英

模态不从ie9的顶部滑动

[英]modal not sliding from top in ie9

当您单击“登录”或“注册”按钮时,模态会打开....模态在chrome浏览器中从顶部向下滑动....就像在ie9浏览器中一样,它会打开....如何修复滑动在IE 9浏览器中的问题...

在下面提供我的代码

http://jsfiddle.net/KNPZB/10/embedded/result/

    <script type="text/javascript">
      $('#myModal').modal({ show: false })
    </script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


<div id="myModal" class="modal hide fade" style="width: 427px; height: 226px;">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>
      </div>
      <div class="modal-body" style="width: 336px;">

        <form method="post" class="navbar-form pull-right" action="http://intra.defie.co/Account/">
              <input class="span2" type="text" name="email" placeholder="Email" style="width: 263px; margin-top: 19px; margin-bottom: 10px;"><br>
              <input class="span2" type="password" name="password" placeholder="Password" style="width: 263px;"><br>
              <button type="submit" class="btn" style="margin-top: 13px; margin-left: 100px;">Sign in</button>
            </form>



      </div>

    </div>

您所包含的javascript文件中至少有两个问题。

  1. <head>部分中,您甚至在加载jquery之前就包含了bootstrap.js 因为看起来您要在页面底部附近才加载jquery。 bootstrap.js需要放在jquery 之后

  2. 您尝试使用无效路径在页面顶部加载bootstrap.js,然后在页面底部加载反而会包含在bootstrap.js中的所有bootstrap javascript文件。 您在这里只需要一种方法:使用boostrap.js(放在jquery之后 ),或仅加载所需的bootstrap插件(同样,放在jquery之后 )。 在引导站点上查看资源,以了解它们的工作方式。 twitter.github.com/bootstrap/

  3. 在顶部和底部附近,您都在加载jquery之前调用jquery函数,因此,如果使用F12打开浏览器控制台,则会看到Uncaught ReferenceError: $ is not defined Chrome中Uncaught ReferenceError: $ is not defined ,而SCRIPT5009: '$' is undefined在IE9中SCRIPT5009: '$' is undefined

  4. 除了所有的javascript源文件问题之外, bootstrap.css文件还具有无效的路径并且无法加载。

我怀疑一旦解决了这些问题,您的页面便可能会以预期的方式运行; 当然,这将是一个不错的起点。

暂无
暂无

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

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