自定义颜色框标题(长标题和位置)

时间:2014-03-07 07:49:38

标签: css colorbox image-gallery caption

例如,请参阅此link

如何在弹出窗口下添加长标题?例如,添加如下三行:

enter image description here 我们可以在标签的标题上添加一行,我试图改变这种风格

#cboxTitle {
position: absolute;
bottom: -25px;
left: 0px;
text-align: center;
width: 100%;
font-weight: bold;
color: #7C7C7C;

} 通过添加高度或顶部:800px,标题deisapear

2 个答案:

答案 0 :(得分:1)

你试过这个吗?

#cboxTitle {
position: absolute;
bottom: -25px;
left: 0;
text-align: right; /* MODIFIED */
width: 600px; /* MODIFIED */
font-weight: bold;
color: #7C7C7C;
word-break: break-word; /* ADDED */
margin-right: 100px; /* ADDED */
margin-left: 100px;  /* ADDED */
}

这将允许2行文字!

然后为了允许更多空间移除另一行,从上面删除以下CSS。 (使用“/ * CSS HERE * /”注释掉,这样你就可以保留代码!)下面的例子

/* bottom: -25px; */

之后,需要花一点时间才能将“图像3的3”部分移动:)

希望这有帮助

答案 1 :(得分:1)

这个解决方案似乎对我有用:

$(document).bind('cbox_complete', function(){
    var cboxTitleHeight = $('#cboxTitle').height();
    var cboxContentHeight = $('#cboxContent').height();
    var cboxWrapperHeight = $('#cboxWrapper').height();
    var colorboxHeight = $('#colorbox').height();

    $('#cboxMiddleLeft, #cboxMiddleRight, #cboxContent').css('height', (cboxContentHeight + cboxTitleHeight) + 'px');
    $('#cboxWrapper').css('height', (cboxWrapperHeight + cboxTitleHeight) + 'px');
    $('#colorbox').css('height', (colorboxHeight + cboxTitleHeight) + 'px');
});

我也找到了这个解决方案https://gist.github.com/eddyyanto/1620742,但似乎不适用于colorbox的v.1.5.x.

相关问题