Im having problems with fancy box with the code below, the link is still going through to youtube. The fancy box starts to 'popup' but then the page directs the youtube link.
JQuery
$("a.youtube-link").click(function(e) {
e.preventDefault();
$.fancybox({
'padding' : 0,
'showCloseButton': false,
'title' : this.title,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/') + '?showinfo=0',
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
});
return false;
});
HTML Code
<div class="img-wrap">
<a href="http://www.youtube.com/watch?v=videoid" class="img-link youtube-link" target="_self">
<img src="link-to-imv" alt="">
</a>
</div>
Any help appreciated.
it seems the problem was:
$('a').on('click touchend', function(e) {
var el = $(this);
var link = el.attr('href');
window.location = link;
});
The above was in my js file to help with iOS touch events, taking this out fixes the problem.