Javascript 如何移动引导弹出框';谁的位置下降了?
所以基本上我有一个Boostrap Popover,它是在父对象中创建的,用于悬停。通过这种方式,用户可以启动popover,然后将鼠标悬停在popover上并在其周围单击其中的链接 尽管如此,我还是需要将这个popover向下移动大约10px(最大值+10px),这样用户就可以轻松地将鼠标移动到popover上。目前,将鼠标移动到popover的唯一方法是跟随popover下方的小箭头 以下是一个例子: jQuery:Javascript 如何移动引导弹出框';谁的位置下降了?,javascript,jquery,css,twitter-bootstrap,Javascript,Jquery,Css,Twitter Bootstrap,所以基本上我有一个Boostrap Popover,它是在父对象中创建的,用于悬停。通过这种方式,用户可以启动popover,然后将鼠标悬停在popover上并在其周围单击其中的链接 尽管如此,我还是需要将这个popover向下移动大约10px(最大值+10px),这样用户就可以轻松地将鼠标移动到popover上。目前,将鼠标移动到popover的唯一方法是跟随popover下方的小箭头 以下是一个例子: jQuery: $('td.chartSection').each(function ()
$('td.chartSection').each(function () {
var $thisElem = $(this);
$thisElem.popover({
placement: 'auto',
trigger: 'hover',
html: true,
container: $thisElem,
animation: true,
title: 'Name goes here',
content: 'This is the popover content. You should be able to mouse over HERE.'
});
});
<table>
<tr>
<td class="chartSection">Chart 1</td>
</tr>
<tr>
<td class="chartSection">Chart 2</td>
</tr>
<tr>
<td class="chartSection">Chart 3</td>
</tr>
</table>
HTML:
$('td.chartSection').each(function () {
var $thisElem = $(this);
$thisElem.popover({
placement: 'auto',
trigger: 'hover',
html: true,
container: $thisElem,
animation: true,
title: 'Name goes here',
content: 'This is the popover content. You should be able to mouse over HERE.'
});
});
<table>
<tr>
<td class="chartSection">Chart 1</td>
</tr>
<tr>
<td class="chartSection">Chart 2</td>
</tr>
<tr>
<td class="chartSection">Chart 3</td>
</tr>
</table>
非常简单:
演示
啊,太容易了,很好的发现。谢谢