这种解决方案适用于一个按钮的情况:Is it possible to use a div as content for Twitter's Popover如何在多个按钮的Twitter Popover中使用“div”?
但在我的网页中,我有一堆popovers(比如50-100)。
所以我需要修改这个解决方案。
这娃@哈维的解决方案:
$(document).ready(function(){
$('.danger').popover({
html : true,
content: function() {
return $('#popover_content_wrapper').html();
}
});
});
我的每一个按钮都有自己的ID。
<a class='danger' data-placement='above' title="Popover Title" href='#'>Click</a>
<div id="popover_div1" style="display: none">
<div>This is your div content</div>
</div>
<a class='danger' data-placement='above' title="Popover Title" href='#'>Click</a>
<div id="popover_div2" style="display: none">
<div>This is your div content</div>
</div>
那么我该如何重写这个javascript代码片段来覆盖我所有的按钮?
工作..谢谢 – Parag 2015-01-22 10:05:25