问题
I cannot figure out why it isn't loading, it seems the same as fancybox's youtube link on their demo homepage. Plus, all the other fancyboxes on the page work. It's here and the one that isn't working is everybody's smoking video.
Here is my html:
<li class="portfolio-tn">
<a class="fancybox" title="A video I made whilst I was giving up smoking. Unfortunately the video tape reel got damaged and the film quality isn't great. " href="http://www.youtube.com/embed/NXzSX5Cbebw">
<img alt="thumbnail of Everybody's Smoking Video" src="images/assets/other_stuff/smokingvideo_thumbnail.png">
</a>
</li>
回答1:
You will need to use an iframe
element to embed video from a different domain.
The fancybox docs say that you can achieve this using one of two ways:
<a href="http://www.example?iframe">This goes to iframe</a>
or
<a class="iframe" href="http://www.example">This goes to iframe</a>
回答2:
for fancybox 2 and video you will need to add
<a class="fancybox-media" href="http://www.youtube.com/watch?v=opj24KnzrWo">My Video</a>
for iframe
<a class="fancybox fancybox.iframe" href="http://osx86.transformnews.com/">My Iframe</a>
example
来源:https://stackoverflow.com/questions/7704225/why-is-my-fancybox-plugin-not-working-for-my-youtube-link