twitter-bootstrap 显示带有溢出的 div 外的引导程序弹出窗口:隐藏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18194705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
display bootstrap popovers outside divs with overflow:hidden
提问by StephanieF
I've got a question about how to get a bootstrap popover to show above (outside) a slider, which has a wrapper of overflow:hidden, that I can't seem to get around.
我有一个关于如何让引导程序弹出框显示在滑块上方(外部)的问题,该滑块具有溢出的包装:隐藏,我似乎无法绕过。
I'm using this slider: http://owlgraphic.com/owlcarousel/I'm also using Twitter bootstrap 2.3.2 popovers: http://getbootstrap.com/2.3.2/javascript.html#popovers
我正在使用这个滑块:http://owlgraphic.com/owlcarousel/ 我也在使用 Twitter bootstrap 2.3.2 popovers:http://getbootstrap.com/2.3.2/javascript.html#popovers
both work well together with the exception of the overflow:hidden on the carousel, which is similar to issues like this: Popovers in Bootstrap 2.2.1https://github.com/twbs/bootstrap/issues/6122
两者都可以很好地协同工作,除了溢出:隐藏在轮播上,这类似于这样的问题: Bootstrap 2.2.1 中的弹出框https://github.com/twbs/bootstrap/issues/6122
My question specifically is: Has anyone gotten this to work? I've done some moves with height and negative margin to get the vertical height showing, but if the popover is at the edge of my wrapping dive, it will get cut off at the edge. please let me know if I need to provide any additional detail.
我的具体问题是:有没有人让它起作用?我已经做了一些高度和负边距的移动来显示垂直高度,但是如果弹出框位于我的环绕潜水的边缘,它会在边缘被切断。如果我需要提供任何其他详细信息,请告诉我。
Thanks Steph
谢谢斯蒂芬
回答by StephanieF
Ok, so I figured this one out.
好的,所以我想出了这个。
I changed:
我变了:
$('.popover-with-html').popover({ html : true, });
to:
到:
$('.popover-with-html').popover({ html : true, container: 'body'});
and it's working.
它正在工作。
container: 'body'
was the key, I hope this helps someone.
是关键,我希望这对某人有帮助。
Thanks
谢谢
Steph
斯蒂芬
回答by shona
Add following in your CSS. Override overflow property of slider.
在您的 CSS 中添加以下内容。覆盖滑块的溢出属性。
.carousel-inner{
overflow:visible;
}
I hope this helps someone.
我希望这可以帮助别人。
Got it from https://github.com/twbs/bootstrap/issues/6091
回答by user3688106
I resolved it by overwriting carousel-inner in my own css. Increase height to show the drop down
我通过在我自己的 css 中覆盖 carousel-inner 来解决它。增加高度以显示下拉菜单
.carousel-inner {height: 350px; width: 100%; min-width: 650px;}

