title: jQuery FancyBox YouTube videos not working
body: <p>I have a situation whereby I cannot modify the HTML code for the anchor tag, with the exception of the 'href' attribute. So adding a class to the anchor tag is not an option.</p>
  
  <p>The HTML markup is as follows:</p>
  
  <pre><code>&lt;a href="http://www.youtube.com/watch?v=#########&amp;amp;autoplay=1"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>To distinguish between this and other links, I have added a selector based on the 'href' to the jQuery code.</p>
  
  <p>The code is as follows:</p>
  
  <pre><code>(function ($) { 
  
    $('a[href*="youtube"]').fancybox({
              'padding' : 0,
              'type' : 'swf',
              'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
              'swf' : { 'wmode' : 'transparent', 'allowfullscreen' : 'true' }
              });
  e.preventDefault();
  
  })(jQuery);
  </code></pre>
  
  <p>This does not seem to be working at all. Can anyone tell me where I am going wrong? I am using Drupal, hence why I have added the part at the top to enable to '$'.</p>
  
  <p>I cannot see any errors in the console, the page simply navigates straight to the YouTube page with no JavaScript intervention.</p>