【问题标题】:Increase the size (height) of the title area in ColorBox增加 ColorBox 中标题区域的大小(高度)
【发布时间】:2012-07-24 23:28:38
【问题描述】:

我正在使用 ColorBox 创建一个标题相当长的幻灯片

<a class="slideshow" href="image.gif" 
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam iaculis velit 
eget augue tincidunt a tempor risus volutpat. Integer tempor sapien justo. Ut 
facilisis odio nec risus aliquet nec rhoncus nunc ultrices. Nulla facilisi. Ut ac 
ligula a metus rhoncus feugiat. Praesent lacinia diam neque, sed tempor felis. Morbi 
sed sapien sem, vitae pulvinar nunc. Fusce metus dolor, iaculis eget venenatis a, 
gravida sed tellus." rel="slides">Slideshow</a>

并且灯箱可以工作,但在所有示例中,为标题留出的空间并不多。如何使标题区域更大,以便 ColorBox 正确调整灯箱“弹性”窗口的大小?


想出了一个不错的解决方案。通过覆盖colorbox.css 中的一些样式,我能够将“标题”移动到背景为灰色的图片中。

#cboxTitle { 
    text-align:justify !important;
    width:98.5% !important; 
    margin-bottom:24px !important;
    padding:5px !important;
    background-color:#333 !important;
    opacity:0.75 !important;
    filter:alpha(opacity=75) !important;
    color:#fff !important;
}

我将这些覆盖基于示例 1 中提供的样式。

【问题讨论】:

  • 你能提供一个演示吗?
  • 您应该自己回答这个问题。您的解决方法工作正常。
  • 这个问题的答案比提供的答案更好。

标签: jquery colorbox


【解决方案1】:

遇到同样的问题。解决方案是在#cboxContent 上强制一些«outerHeight»,这将从图像的可用高度中减去。

所以:

#cboxContent {
    padding-bottom:50px;
}

考虑到#cboxTitle 应该是绝对的,你也可以固定它的高度:

#cboxTitle {
    height:50px;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-14
    相关资源
    最近更新 更多