Here is my HTML:
<a class="video iframe" href="http://www.youtube.com/watch?v=Psk2Pq03rv0">Arbitrary text</a>
Here is the Fancybox javascript:
$("a.video").fancybox({
'padding' : 0,
'autoScale' : false,
'title' : this.title,
'overlayOpacity' : '.6',
'overlayColor' : '#333',
'transitionIn' : 'none',
'transitionOut' : 'none',
'centerOnScroll' : false,
'showCloseButton' : true,
'hideOnOverlayClick': false,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), "v/"),
'type' : 'swf',
'swf' : {
'wmode': 'transparent',
'allowfullscreen': 'true'
}
});
Firebug Console says:
this.href is undefined
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
As a result, clicking this link takes the user to YouTube and does not trigger Fancybox. Any advice?