Skip to content

Instantly share code, notes, and snippets.

@aphoenix
Created July 29, 2011 14:30
Show Gist options
  • Save aphoenix/1113914 to your computer and use it in GitHub Desktop.
Save aphoenix/1113914 to your computer and use it in GitHub Desktop.
The HTML that is generated by fancyTitle does not seem to get the behaviour for #fancyplay
function fancyTitle(title, currentArray, currentIndex, currentOpts) {
return '<div id="fancydescription">' + (title && title.length ? '<span>' + title + '&nbsp;</span>' : '' ) + '</div><div id="fancycount">Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div><div id="fancycontrols"><a href="#" id="fancyplay">Play</a> <a href="#" id="fancypause"> Pause</a></div><div style="clear:both;"></div>';
}
$('.fancybox').fancybox({
'titleFormat' : fancyTitle,
'cyclic' : true,
'overlayColor' : '#000',
'overlayOpacity' : 0.5
});
$('#fancyplay').live('click',function(event) {
//Do something
alert('Vas is los?')
event.preventDefault();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment