.index()
.eq()
这样地:
$("#video-display .video:gt(0)").hide();
$("#thumb li").click(function() {
$("#video-display .video").hide().eq($(this).index()).show();
});âââââââââââââ
You can try it out here
,如果要移动
.active
上课的时候,加几个
.addClass()
.removeClass()
打电话,像这样:
$("#video-display .video:not(.active)").hide(); //hide initially
$("#thumb li").click(function() {
$(this).addClass('active').siblings().removeClass('active'); //<li> portion
$("#video-display .video").hide().removeClass('active') //hide previous
.eq($(this).index()).show().addClass('active'); //show new
});âââââââââââââ
两者的方法都是选择视频
<div>
#video-display
<li>
你在里面点击了
#thumb