【发布时间】:2012-06-07 11:51:35
【问题描述】:
我在引导下拉菜单中放置了一个表单,但是当我单击表单中的任何字段时,下拉菜单就会消失。我有这段代码,但我不知道把它放在哪里以防止下拉菜单消失。
$(function test() {
// Setup drop down menu
$('.dropdown-toggle').dropdown();
// Fix input element click problem
$('.dropdown input, .dropdown label').click(function(e) {
e.stopPropagation();
});
});
谁能告诉我我应该把这个放在哪里?我在 bootstrap-dropdown 中尝试过,我在 HTML 中尝试过,但它仍然无法正常工作。
【问题讨论】:
标签: javascript html drop-down-menu twitter-bootstrap