简体   繁体   English

引导按钮无法打开模式

[英]Bootstrap button doesn't open modal

I've got a button: 我有一个按钮:

<a data-target='#login' role='button' class='btn' data-toggle='modal'>Login</a>

That was working earlier, but now it won't open my modal. 那早就可以了,但是现在无法打开我的模态了。
Here is my modal: 这是我的模态:

<!-- Login Modal -->
<div id="login" class="modal hide fade" tabindex="-1" aria-labelledby="loginform" aria-hidden="true">

<!-- Header -->
<div class="modal-header">

  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  <h3>Welcome!</h3>

</div><!--/header -->

<!-- Body -->
<div class="modal-body">

  <form action="loginmanager.php" class="form-signin" method="post">

    <input name="username" type="text" class="input-block-level" placeholder="Username">
    <input name="password" type="password" class="input-block-level" placeholder="Password">
    <label class="checkbox">
      <input type="checkbox" value="remember-me">"Remember me"</label>
    </label>
    <button class="btn btn-large btn-primary" type="submit">Sign in</button>

   </form>

</div><!--/.modal-body -->

<!-- Footer -->
<div class="modal-footer">

  <a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Close</a>

</div><!--/.modal-footer -->

What in the world did I do wrong? 我到底做错了什么? I looked at it multiple times and can't find why 我看了很多遍,找不到原因

Probably you're missing the inclusion of "bootstrap.js" (or, in the specific, the "bootstrap-modal.js") 可能您没有包含“ bootstrap.js”(或者,具体来说是“ bootstrap-modal.js”)

Try to make your 'package' here (with the Modals) and to include the javascript in your page: http://twitter.github.io/bootstrap/customize.html 尝试在此处(使用“模态”)制作“包”,并将javascript包含在您的页面中: http : //twitter.github.io/bootstrap/customize.html

Found the answer. 找到了答案。 I corrupted my .js and .css files when I used find and replace. 使用查找和替换时,我损坏了.js和.css文件。 Whoops! 哎呀!

只需从此行中删除“隐藏”类

<div id="login" class="modal hide fade" tabindex="-1" aria-labelledby="loginform" aria-hidden="true">

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

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