引导jQuery show.bs.modal事件不会触发 [英] bootstrap jquery show.bs.modal event won't fire

查看:553
本文介绍了引导jQuery show.bs.modal事件不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用引导3文档中的模式示例.模态作品.但是,我需要在触发时访问show.bs.modal事件.现在,我只是在尝试:

i'm using the modal example from the bootstrap 3 docs. the modal works. however i need to access the show.bs.modal event when it fires. for now i'm just trying:

$('#myModal').on('show.bs.modal', function () {
   alert('hi')
})

没有任何反应,该事件不会触发.我究竟做错了什么???这对我来说没有意义.

Nothing happens, the event does not fire. What am I doing wrong??? This doesn't make sense to me.

推荐答案

使用此:

$(document).on('show.bs.modal','#myModal', function () {
  alert('hi');
})

这篇关于引导jQuery show.bs.modal事件不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆