Bootstrap利用圖片來觸發modal視窗


Bootstrap 官網裡的範例 是用按鈕(Button)來觸發 modal 視窗

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>

若不想用按鈕(Button),想用 image 來觸發,該怎樣做? 經過Google [3] 後,發現 [1] 有解答:

<a href="#myModal" data-toggle="modal">
  <img src="/img/myImage.png">
</a>

參考:

[1]Can I use an image to trigger a modal window in Bootstrap?
[2]Bootstrap Image trigger modal example code
[3]Google搜尋 Bootstrap image trigger modal