Skip to content

jQuery Colorbox not showing but background shows

I was using Colorbox for some lightbox type effects to show larger images when clicking on thumbnails, but for some reason the background was showing up but the pretty little box in the middle where the larger image is supposed to show never showed up, so this is how I made it finally appear after many failed attempts!

$("document").ready(function(){ $(".theCssClass a[rel='forGroupingRelCodeGoesHere']").colorbox({ onLoad: function () { $("#colorbox").show(); } }); });
Code language: JavaScript (javascript)

So the “real” code that fixed it was the:

{ onLoad: function () { $("#colorbox").show(); } }
Code language: CSS (css)

This worked because the DOM was loading all the right things but the actual main parent element of the colorbox wasn’t changing it’s CSS to show the image.

See also  Windows 7 is better than Ubuntu 12.04 on desktop!
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x