不确定如何去做这件事。
[代码]
<!-- Add jQuery library -->
<script type="text/javascript" src="../lib/jquery-1.10.1.min.js"></script>
<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="../lib/jquery.mousewheel-3.0.6.pack.js"></script>
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.5"></script>
<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.5" media="screen" />
<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
<script type="text/javascript" src="../source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<!-- Add Thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
<script type="text/javascript" src="../source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<!-- Add Media helper (this is optional) -->
<script type="text/javascript" src="../source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.fancybox').fancybox();
$('.fancybox-media')
.attr('rel', 'media-gallery')
.fancybox({
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
arrows : false,
helpers : {
media : {},
buttons : {}
}
});
});
function autoClick1() {
document.getElementById('onload1').click();
}
function autoClick2() {
document.getElementById('onload2').click();
}
</script>
</style>
</head>
<body onLoad="autoClick1();autoClick2();">
<ul>
<li><a class="fancybox-media" href="http://www.youtube.com/watch?v=opj24KnzrWo" id="onload1">Youtube</a></li>
<li><a class="fancybox-media" href="http://www.youtube.com/watch?v=hnBN1Epc5qs" id="onload2">Youtube2</a></li>
</ul>
我的例子是使用onLoad,它只允许播放最后一个视频。它还播放没有URL参数的视频,因此它可以在每个页面加载时播放。我不知道该怎么做。任何帮助表示赞赏!