Twitter Bootstrap, popover scroll in separate panels

穿精又带淫゛_ 提交于 2019-12-08 09:33:14

问题


I have a problem with Twitter bootstrap popover scroll. I have read and searched for a solution with no luck.

I have made buttons with popovers in separate panels, and when I scroll, the popover does not stay with the button. I.e it stays fixed while the panel scrolls.

This is not a problem when I scroll the entire page; only in the separate panels. Please see live demo here, and screenshot below for reference.

(I have some further problems with the same layout, but will create separate questions for those).

AH! as Schmalzy helped me figure out it was simply a parent that needed position relative. Then a new problem popped up, as illustrated below. How do I get the popover to lie on top of all panels?


回答1:


You can change its positioning to relative and it seems to work correctly.

.popover{
    position: relative; 
}

Although this will push your text/content of the panel down past the popover...

Here is a fiddle that demos it.

Also, this seems to work with no changes needed in 3.0RC1

Here is a fiddle with this in 3.0RC1




回答2:


If you change the popover's parent container to position: relative it will scroll with the panel.

jsFiddle



来源:https://stackoverflow.com/questions/18058623/twitter-bootstrap-popover-scroll-in-separate-panels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!