我尝试使用bootstrap中的模态,但我想使用图像而不是按钮.但我根本没有看到如何做到这一点.在哪里插入
data-toggle="modal" data-target="#myModal
http://getbootstrap.com/javascript/#modals
引导模态
<!-- Button trigger modal --> <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> Launch demo modal </button> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
解决方法
您可以将图像放在这样的链接中……
<a data-toggle="modal" data-target="#myModal"> <img src="//placehold.it/100x30"> </a>