简体   繁体   中英

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")

Try to make your 'package' here (with the Modals) and to include the javascript in your page: http://twitter.github.io/bootstrap/customize.html

Found the answer. I corrupted my .js and .css files when I used find and replace. Whoops!

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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