Skip to content

Instantly share code, notes, and snippets.

@kathangeorg
Created March 28, 2012 10:31
Show Gist options
  • Save kathangeorg/2225283 to your computer and use it in GitHub Desktop.
Save kathangeorg/2225283 to your computer and use it in GitHub Desktop.
Fancybox title multi-line
//Title Format
function str_replace(search, replace, subject) {
return subject.split(search).join(replace);
}
function formatTitle(title, currentArray, currentIndex, currentOpts) {
return '<div id="ttt">'+str_replace("|", "<br>", title)+'</div>';
}
// Image
jQuery("a.lightbox").fancybox({
'zoomSpeedIn': 300,
'zoomSpeedOut': 300,
'overlayShow': true,
'titleFormat' : formatTitle,
'titlePosition': 'inside'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment