我有youtube链接到JW播放器。一切都很好。现在如何把这个播放器(这个代码)放入fancybox?
<div id="player_779">
<embed type="application/x-shockwave-flash"
src="http://teodore.ge/site/content/scripts/mediaplayer/player.swf"
width="640" height="383"
style="undefined" id="player_779" name="player_779"
quality="high" allowfullscreen="true"
allowscriptaccess="always" wmode="opaque"
flashvars="file=http://youtu.be/VHcrPImvWlk&skin=http://teodore.ge/site/content/scripts/mediaplayer/nacht.zip&autostart=true">
</div>
</div>
你能举个例子吗?
答案 0 :(得分:0)
<a class='video' data-width="600" data-height="345" >link</a>
<script>
$(".video").fancybox({
fitToView: false, // to show videos in their own size
content: '<span></span>', // create temp content
scrolling: 'no', // don't show scrolling bars in fancybox
afterLoad: function () {
// get dimensions from data attributes
var $width = $(this.element).data('width');
var $height = $(this.element).data('height');
// replace temp content
this.content = ' <embed type="application/x-shockwave-flash" src="http://ww.ge/site/content/scripts/mediaplayer/player.swf" width="640" height="383" style="undefined" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="file=http://youtu.be/VHcrPImvWlk&skin=http://www.ge/site/content/scripts/mediaplayer/nacht.zip&autostart=true">';
}
});
</script>