防止引导工具提示隐藏面板底部边框



点击查看代码示例

问题:

我有一个引导面板,其中包含一个列表组。如果我在最后一个列表组项中添加工具提示,则面板的底部边框会消失。

解决方案的尝试:

我怀疑这可能是以下两个问题之一造成的:

  1. 当工具提示出现时,面板的高度正在下降。
  2. 列表组项的下边框覆盖面板的下边框。

我开始怀疑#2,因为在bootstrap css中有以下内容:

.panel>.list-group:last-child .list-group-item:last-child {
    border-bottom:0;
    border-bottom-right-radius:3px;
    border-bottom-left-radius:3px
}

由于工具提示向列表组添加了另一个元素,因此列表组项不再是最后一个子元素,因此此规则不再适用。但是,将.list-group-item:last-child更改为.list-group-item:last-of-type后,可以有效地忽略工具提示,问题仍然存在。

可以在tooltip()上使用container选项。这将把弹出窗口添加到父row,而不会影响list-group的样式。

$('.list-group-item').tooltip({container:'.row'})
http://www.bootply.com/WpRFe2EyaM

最新更新