hondy.net视频播放应用:
var videos = $('video');
for (var i = videos.length - 1; i >= 0; i--) {
(function (n) {
if(n==0)return;
videos[n].addEventListener('play', function () {
pauseAll(n);
})
})(i)
}
function pauseAll(index) {
videos[0].pause();
var src=videos[0].src;
videos[0].src=videos[index].src;
videos[index].src=src;
var title=videos.eq(0).closest("li").find(".title").html();
videos.eq(0).closest("li").find(".title").html(videos.eq(index).closest("li").find(".title").html());
videos.eq(index).closest("li").find(".title").html(title);
videos[0].play();
$("html, body").animate({
scrollTop: $("#Video").offset().top
}, {
duration: 500,
easing: "swing"
});
};
|