Created
March 24, 2011 08:59
-
-
Save gacha/884767 to your computer and use it in GitHub Desktop.
This solves the long title problem on ColorBox. Tested only for this design http://colorpowered.com/colorbox/core/example1/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).bind('cbox_complete', function(){ | |
if($('#cboxTitle').height() > 20){ | |
$("#cboxTitle").hide(); | |
$("<div>"+$("#cboxTitle").html()+"</div>").css({color: $("#cboxTitle").css('color')}).insertAfter("#cboxPhoto"); | |
$.fn.colorbox.resize(); | |
} | |
}); |
Thank you for giving this.
For ColorBox v1.3.17.2 this works fine.
$(document).bind("cbox_complete", function(){
if($("#cboxTitle").height() > 20){
$("#cboxTitle").hide();
$("#cboxLoadedContent").append("
"+$("#cboxTitle").html()+"
").css({color: $("#cboxTitle").css("color")});$.fn.colorbox.resize();
}
});
For v1.4.4, I went with this slight modification in order to treat all captions the same. I found that even though some captions didn't wrap they still got in the way of the navigation elements.
$('a[rel*=colorbox]').colorbox({onComplete:function(){
$("#cboxTitle").hide();
$("#cboxLoadedContent").append($("#cboxTitle").html()).css({color: $("#cboxTitle").css("color")});
$.fn.colorbox.resize();
}})
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This differs from colorbox version.