If you are using jQuery plugin called fancybox for displaying images in the overlay and you want to display some texts on the overlay, you can just set the title attribute of the anchor tag as follows:
Click to show image
Then your plugin implementation code should look like this:
$(document).ready(function() {
$("# show-image ").fancybox({
'titlePosition' : 'inside'
});
});
And another major problem that I faced recently is, I want to replace the title in the overlay with Cufon. Since the title in the overlay is rendered by the fancybox script, Cofon does not load and work for that. You need to replace the fonts after the overlay is completed. For this there is an event called onComplete in fancybox, where you can call the cufon refresh or replacement function like below:
$(document).ready(function() {
$("# show-image ").fancybox({
'titlePosition' : 'inside',
'onComplete' : applyCufon
});
});
function applyCufon(){
Cufon.replace('#fancybox-title', { fontFamily: 'Deutsch Gothic' });
}
Hope this will help you all who are really having problem with this.