javascript 颜色框滚动条
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13037674/
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
Colorbox Scrollbars
提问by L84
I have an image that opens in a a lightbox (Colorbox is the script). When the image opens I added a CSS3 Animation. Works great but at first the lightbox has scrollbars which disappear once the animation is complete.
我有一个在灯箱中打开的图像(Colorbox 是脚本)。当图像打开时,我添加了一个 CSS3 动画。效果很好,但起初灯箱有滚动条,一旦动画完成就会消失。
How do I prevent the lightbox from showing scrollbars at all?
如何防止灯箱根本不显示滚动条?
Code:
代码:
#start{
/* Width and Height of the Image */
width:526px;
height:450px;
}
<div class="hide">
<div id="start">
<img src="/Images/designs/start-large.jpg" class="animated rollIn">
</div>
</div>
采纳答案by pfried
You could try to add overflow:hidden;
to your CSS style of the div / img. Or try overflow:visible;
if it cuts off something.
您可以尝试将overflow:hidden;
div / img 的 CSS 样式添加到您的 CSS 样式中。或者尝试overflow:visible;
它是否切断了某些东西。
回答by Ricardo Alvaro Lohmann
You can use colorbox.resize()
to automatic calculate its size or use overflow hidden
to the parents of your content.
Both ways works.
您可以使用colorbox.resize()
自动计算其大小或使用overflow hidden
您的内容的父级。
两种方式都有效。
回答by Ahmed Al Bermawy
#cboxLoadedContent{overflow:hidden !important;}
This is working for me.
这对我有用。
回答by Tim
Set the colorbox setting scrolling
to false
to disable scrollbars on content.
将颜色框设置设置scrolling
为false
禁用内容滚动条。
回答by Dishan TD
Add scrolling: false
添加滚动:false
$.colorbox({
inline:true,
width:'95%',
scrolling: false // *********
});