Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize colorbox caption (long caption and position of it)

Please see this link for example.

How can add a long caption under popup? For example, adding 3 lines like this:

enter image description here we can add one line to title of tag and I tried to change this style

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

} by adding height or top:800px, caption deisapear

like image 805
user3250818 Avatar asked Mar 07 '14 07:03

user3250818


1 Answers

This solution seems to work for me:

$(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');
});

I also found this solution https://gist.github.com/eddyyanto/1620742 , but doesn't seem to work with v.1.5.x of colorbox.

like image 79
Frugan Avatar answered Sep 29 '22 12:09

Frugan