ruby-on-rails – 模态引导程序,图像而不是按钮

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 模态引导程序,图像而不是按钮前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试使用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">&times;</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>

演示:http://bootply.com/98748

猜你在找的Ruby相关文章