Bootstrap的弹出窗口很容易在像demo这样的标签上使用。有没有办法将它用于悬停事件和div标签?
HTML:
<div class="container">
<a id="popoverData" class="btn" href="#" data-content="Popover with data-trigger" rel="popover" data-placement="bottom" data-original-title="Title" data-trigger="hover">Popover with data-trigger</a>
<a id="popoverOption" class="btn" href="#" data-content="Popup with option trigger" rel="popover" data-placement="bottom" data-original-title="Title">Popup with option trigger</a>
</div>
JS:
$('#mytext').popover();
$('#name').popover();
答案 0 :(得分:1)
为什么不呢?
请参阅此jsFiddle:http://jsfiddle.net/9P64a/2892/
<强> HTML 强>
<div id="container" data-content="Popup with option trigger" rel="popover" data-placement="bottom" data-original-title="Title">
Whatever you want.
</div>
<强>的javascript 强>
$('#container').popover({ trigger: "hover" });