最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Colorbox Scrollbars - Stack Overflow

programmeradmin0浏览0评论

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.

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>

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.

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>
Share Improve this question asked Oct 23, 2012 at 19:22 L84L84 46.3k59 gold badges181 silver badges259 bronze badges
Add a comment  | 

5 Answers 5

Reset to default 5

Set the colorbox setting scrolling to false to disable scrollbars on content.

#cboxLoadedContent{overflow:hidden !important;}

This is working for me.

You can use colorbox.resize() to automatic calculate its size or use overflow hidden to the parents of your content.
Both ways works.

You could try to add overflow:hidden; to your CSS style of the div / img. Or try overflow:visible; if it cuts off something.

Add scrolling: false

$.colorbox({
  inline:true, 
  width:'95%',
  scrolling: false // *********
});
发布评论

评论列表(0)

  1. 暂无评论