Bootstrap 3下拉事件未触发 [英] Bootstrap 3 dropdown events not firing
本文介绍了Bootstrap 3下拉事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在BS3.0上运行的这个站点的下拉列表中显示一个显示的事件
I am trying to get an shown event fired at dropdown at this site running on BS3.0
http://hmelius.com/avant/index.php
我试过这段代码控制台(来自BS3文档页面)但没有运气
I have tried this code in the console (from the BS3 documentation page) but with no luck
$('.dropdown-toggle').on('shown.bs.dropdown', function () {
console.log("shown");
});
推荐答案
我相信这些事件不会触发父母切换,所以它将是切换点上方的元素,其中 .dropdown
或 .btn-group
;下拉包装元素
I believe the events fire on the "parent" not the toggle, so it would be the element above the toggle with .dropdown
or .btn-group
; the dropdown wrapping element
看一下来源,看看我的意思: https://github.com/twbs/bootstrap/blob/master/js/dropdown.js
take a look at the source to see what I mean: https://github.com/twbs/bootstrap/blob/master/js/dropdown.js
这篇关于Bootstrap 3下拉事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文