0

hello I have a problem with the modal window trigger button. If I put an icon in it I can't click on the button. What should I do?

<button type="button" data-toggle="modal" data-target="#modal_help" 
        class="btn btn-inverse" title="Help">
    <i class="icon-question-sign icon-white"></i>
</button>
4

1 回答 1

1

试试这个,演示在这里

 <button type="button" data-toggle="modal" data-target="#modal_help" class="btn btn-inverse" title="Help">
  <i class="icon-question-sign icon-white"></i>
</button>

<!-- Modal -->
<div id="modal_help" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
    </div>
    <div class="modal-body">
    <p>One fine body…&lt;/p>
    </div>
    <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <button class="btn btn-primary">Save changes</button>
    </div>
</div>

你必须添加bootstrap.css

<link rel="stylesheet" href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css"/>

jquery.js和_bootstrap.js

<script src="http://getbootstrap.com/2.3.2/assets/js/jquery.js"></script>
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.js"></script>
于 2013-09-29T18:22:56.043 回答