Opening bootstrap modal with double click

随声附和 提交于 2019-12-02 00:04:32

问题


I'm trying to open a modal double clicking. I'm using this piece of code but it's not working:

$('#link').dblclick(function () {
  $('#myModal').modal('toggle');
});

Fiddle here: http://jsfiddle.net/labanino/JKEj3/

Thanks!


回答1:


You need to remove data-toggle="modal" from the link..

<a href="#myModal" role="button" class="btn" id="link">Launch modal</a>

http://jsfiddle.net/JKEj3/3/




回答2:


You need to remove data-toggle="modal" from button definition.

http://jsfiddle.net/JKEj3/5/



来源:https://stackoverflow.com/questions/16726303/opening-bootstrap-modal-with-double-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!