You forgot to link the jquery.fancybox-media.js
file, which would allow you to use the media
helper. Tested your code with the helper added and it worked just fine.
fancybox YouTube link not working at all
-
05-10-2022 - |
Pergunta
I get no console errors whatsoever. Here is the code I am using:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<link rel="stylesheet" href="http://localhost/punx/wordpress/wp-content/themes/bone-theme/fancybox/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="http://localhost/punx/wordpress/wp-content/themes/bone-theme/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.fancybox-media').fancybox({
openEffect : 'none',
closeEffect : 'none',
helpers : {
media : {}
}
});
});
</script>
<div class="video-item">
<a class="fancybox-media" href="http://www.youtube.com/watch?v=E34eBjaqmgo&feature=youtube_gdata_player">
<img src="http://i1.ytimg.com/vi/E34eBjaqmgo/0.jpg" alt="" />
<span>Video Title Here</span>
</a>
</div>
The link simply takes me directly to YouTube. Like I said, I get no console errors.
Any help would be appreciated.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow