$(function() { var con_w = $(".mark-main").width() , list_w = con_w / 4 , mar_l = list_w / 2; $(".system_list").css("width", list_w); $(".click_con").css("margin-left", -mar_l); var stye_list = $(".mark-main").width() + 10; var system = ($(".system_list").length) * stye_list; $(".click_con").css("width", system + 'px'); $(".hover_R").click(function() { var index = $(".new_cur").index() + 1; var system1 = $(".system_list").length; var wid1 = $(".system_list").width() + 10; //960 var uwid = $(".mark-main").scrollLeft(); var val_ = uwid + wid1; $(".new_cur").next().addClass("new_cur").siblings().removeClass("new_cur"); $(".mark-main").animate({ scrollLeft: wid1 }, function() { $(".click_con .system_list:first").insertAfter($(".click_con .system_list:last")); $(".mark-main").scrollLeft(0); }); }); $(".hover_L").click(function() { var index = $(".new_cur").index(); var wid1 = $(".system_list").width() + 10; var uwid = $(".mark-main").scrollLeft(); var val_ = uwid - wid1; $(".new_cur").prev().addClass("new_cur").siblings().removeClass("new_cur"); $(".mark-main").scrollLeft(wid1); $(".click_con .system_list:last").insertBefore($(".click_con .system_list:first")); $(".mark-main").animate({ scrollLeft: 0 }); }) }); window.onload=function() { var imgl=document.getElementById('play').getElementsByTagName('li'); var bt=document.getElementById('button'); for(var a=0;imgl.length>a;a++){ bt.innerHTML+='
  • '; } var oPlay=document.getElementById('play'); var aLi=oPlay.getElementsByTagName('li'); var oButton=document.getElementById('button'); var aDiv=oButton.getElementsByTagName('div'); var oPrev=document.getElementById('prev'); var oNext=document.getElementById('next'); var oFlash=document.getElementById('flash'); var now=0; var timer2=null; for(var i=0; i<aDiv.length; i++) { aDiv[i].index=i; aDiv[i].onmouseover=function(){ if(now==this.index) return; now=this.index; tab(); } } oPrev.onclick=function(){ now--; if(now==-1){ now=aDiv.length-1; } tab(); } oNext.onclick=function(){ now++; if(now==aDiv.length){ now=0; } tab(); } oFlash.onmouseover=function() { clearInterval(timer2); } oFlash.onmouseout=function() { timer2=setInterval(oNext.onclick,4000); } timer2=setInterval(oNext.onclick,5000); function tab(){ for(var i=0; i<aLi.length; i++){ aLi[i].style.display='none'; } for(var i=0; i<aDiv.length; i++) { aDiv[i].style.background="#DDDDDD"; } aDiv[now].style.background='#A10000'; aLi[now].style.display='block'; aLi[now].style.opacity=0; aLi[now].style.filter="alpha(opacity=0)"; jianbian(aLi[now]); } function jianbian(obj){ var alpha=0; clearInterval(timer); var timer=setInterval(function(){ alpha++; obj.style.opacity=alpha/100; obj.style.filter="alpha(opacity="+alpha+")"; if(alpha==100) { clearInterval(timer); } },10); } }