facny盒將允許,因爲它的內容,據我知道,是實現您與指定的工具叫什麼的唯一方法您加載一個iframe
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#image").live('click',function(){
$.fancybox({
'width' : '75%',
'height' : '75%',
'autoScale' : true,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe',
'href' : 'video.html'
});
});
});
</script>
<div id="wrapper">
<div id="image">
<img height='480px' src='images/image.jpg'>
</div>
</div>
而且您的video.html頁面需要具有videojs代碼,因爲此代碼適用於我使用的iPad Web應用程序,因此我只在示例中提供了該視頻的mp4版本。注意視頻標籤中的自動播放參數。
<!-- Begin VideoJS -->
<div class="video-js-box">
<!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
<video id="example_video_1" class="video-js" width="100%" height="95%" controls="controls" preload="auto" autoplay poster="images/image.jpg">
<source src="video/videoSource.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<!-- Image Fallback. Typically the same as the poster image. -->
<img src="images/image.jpg" width="640" height="264" alt="Poster Image"
title="No video playback capabilities." />
</object>
</video>
</div>
<!-- End VideoJS -->
如何將視頻JS生成的HTML代碼直接添加到Fancybox? – Raptor