所以,使用Bootstrap 4,我有一个设置为.sticky-top的导航栏。有一个按钮可以调用一个弹出窗口,在页面滚动一点之前效果很好,然后弹出窗口的顶部隐藏。
如果它仅在滚动时发生,那也不会太糟糕。真正的问题是,如果在滚动后打开弹出窗口,内容仍然是隐藏的。
这是一个显示问题的小提琴:
https://jsfiddle.net/vfpb7r2d/16/
最相关的代码:
<div class="sticky-top bg-dark p-2">
<div class="btn btn-primary" data-toggle="popover" title="More information..." data-content="Isn't there a way to keep the whole popover visible??? The longer the popover content becomes, the more of the content disappears with scrolling. (There does seem to be a maximum cutoff point, but I haven't tried to measure what it is.)" />Button</div>
</div>
有什么方法可以解决这个问题吗?
答案 0 :(得分:2)
将data-boundary="viewport"
添加到popover元素。
<div class="btn btn-primary" data-toggle="popover" data-boundary="viewport" title="More information..." data-content="Isn't there a way to keep the whole popover visible?">Button</div>