I'm using JQ Colorbox plug-in (a sort of Lightbox) and I'd like to add a class to the body of a document loaded via Colorbox's iframe function.
Basically, I was trying to:
$("iframe").contents().find('body').addClass('foo');
but that doesn't seem to work, probably because my iframes are not generated until after a user invoke C开发者_运维问答olorbox?
Is there a way to achieve such result?
Many thanks.
The ColorBox documentation says that there are 4 event hooks you can use. For example (lifted from their examples page);
$("#myColorBox").colorbox({
onComplete: function(){
alert('onComplete: colorbox has displayed the loaded content');
}
});
精彩评论