我有一个视频滑块,可以通过单击缩略图然后播放视频来工作。问题是我正在尝试创建一个函数,以便视频淡入而不是仅仅出现。我可以正常做到这一点,但由于缩略图/视频是列表形式,我对如何设置它感到困惑。身体部位是这样的
<div id="wrapper">
<div id="bigPic">
<video alt="" height="786" width="1024" style="margin-left:-8px; margin-top:-16px;"/>
<video alt="" height="786" width="1024" style="margin-left:-8px; margin-top:-16px;"/>
<video alt="" height="786" width="1024" style="margin-left:-8px; margin-top:-16px;"/>
<video alt="" height="786" width="1024" style="margin-left:-8px; margin-top:-16px;"/>
<video alt="" height="786" width="1024" style="margin-left:-8px; margin-top:-16px;"/>
<video alt="" height="786" width="1024" style="margin-left:-8px; margin-top:-16px;"/>
</div>
<div class="buttons">
<div id="content">
<ul class='thumbs'>
<li rel='1'><img src="graphics/filler.png" alt="" width="281" height="128" onClick="javascript:playVideo1();"/></li>
<li rel='2'><img src="graphics/filler2.png" alt="" width="281" height="128" onClick="javascript:playVideo2();"/></li>
<li rel='3'><img src="graphics/filler.png" alt="" width="281" height="128" onClick="javascript:playVideo3();"/></li>
<li rel='4'><img src="graphics/filler2.png" alt="" width="281" height="128" onClick="javascript:playVideo4();"/></li>
<li rel='5'><img src="graphics/filler.png" alt="" width="281" height="128" onClick="javascript:playVideo5();"/></li>
<li rel='6'><img src="graphics/filler2.png" alt="" width="281" height="128" onClick="javascript:playVideo6();"/></li>
</ul>
</div>
</div>
</div>
播放视频(至少第一个)的功能是
function playVideo1() {
var myVideo = document.getElementsByTagName('video')[0];
myVideo.src = 'images/clip2.mp4'
myVideo.load();
myVideo.play();
myVideo.easeIn();
}