【发布时间】:2013-04-09 21:13:01
【问题描述】:
我在数据表上使用bootstrap popover,正如您从下面的 jsFiddle 中看到的那样,单击每个单元格时都会创建一个弹出框。
我正在尝试为连续的最后一个 td 调整弹出框的位置或“放置”,其想法是单击最后一个单元格时,弹出框将位于左侧而不是顶部。
如果您滚动到表格末尾,您将看到单击我已实现选择但未实现定位的最后一个单元格。
关于如何实现这一点的任何想法?
这里是 javascript 的弹出框:
$(".metapop").popover({
html: true,
trigger: 'manual',
placement: 'top',
title: "You clicked on this cell:",
content: 'hello this is a popover'
}).click(function(e) {
$('.popover').hide();
$(this).popover('show');
if($(this).parent().is('td:last-child'))
{
alert($(this))
}
});
【问题讨论】:
标签: javascript jquery twitter-bootstrap popup