我正在使用Bootstrap js彈出窗口顯示帶有鏈接的html列表。但我有麻煩抓住了他們的鏈接被點擊了jQuery選擇時:單擊Bootstrap彈出窗口中的鏈接
爲酥料餅的元素:
<span class="popoverSpan" data-style="listPopovers" data-html="true" data-container="body" data-placement="bottom" data-trigger="focus" data-toggle="popover" tabindex="0" data-original-title="" title="">Menu</span>
<div>
<ul id="forPopover" class="dropdown-menu popover-content">
<li id="List_3" class="subgroups">
<a id="aInner">Students</a>
</li>
<li id="" class="subgroups">
<a id="bInner">Teachers</a>
</li>
</ul>
</div>
$(".popoverSpan").popover({
html: true,
content: function() {
return $('#forPopover').html();
}
});
$('body').on('click', '.subgroups a', function (event) {
alert('a');
});
我上面的酥料餅的HTML和jQuery和引導代碼下面。警報('a')是間歇性的。爲什麼會出現這種情況,我該如何解決?謝謝。
你可以創建一個小提琴嗎? –
你能告訴我你在找什麼東西......這裏是我創建的小提琴http://jsfiddle.net/sandenay/mfnevhon/ –
上面的小提示顯示了我的意思。它不會一直工作:http://screencast.com/t/BzAW0tgaRDok – cdub