我正在使用 Bootstrap,我试图在单击按钮时在下拉菜单上声明一个事件。出于某种奇怪的原因,jquery 事件没有触发。下拉菜单应在搜索查询元素的正下方下拉。我的 JS Fiddle 是http://jsfiddle.net/sean3200/fNrZ3/ ...任何帮助将不胜感激..Thankszz!下面是部分代码
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Forbes Clientel</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li>
<a href="#" class="active">Home</a>
</li>
<li>
<a href="#">Contact</a>
</li>
</ul>
</div>
<form class="navbar-search">
<input class="search-query" placeholder="Search..." type="text">
<div id="drop" class="dropdown">
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li>
<a tabindex="-1" href="#">Action</a>
</li>
<li>
<a tabindex="-1" href="#">Another action</a>
</li>
<li>
<a tabindex="-1" href="#">Something else here</a>
</li>
<li class="divider"></li>
<li>
<a tabindex="-1" href="#">Separated link</a>
</li>
</ul>
</div>
</form>
</div>
</div>
</div>
<div class="container">
<div class="hero-unit">
<h1>Forbes Clientel</h1>
<p>FC is a directory of the top forbes earning entrepreneurs</p>
<input id="myBtn"
class="btn btn-primary btn-large" value="Search" type="button">
</div>
</div>
</div>
//script
$(document).ready(function(){
$("#myBtn").click(function(){
$("#drop").slidedown();
})
})