function m2(){ length2 = $('.slidepros2 li').length; $('.slidepros2 ul').css({'width':length*onesize}); $('.slidepros2 dd a').hover(function(){ index2 = $('.slidepros2 dd a').index($(this)); mt2(); }); } function run2(){ index2++; if(index2 == length2){ index2=0; } mt2(); } function mt2(){ $('.slidepros2 dd a').removeclass('current'); $('.slidepros2 dd a').eq(index2).addclass('current'); $('.slidepros2 ul').stop().animate({'left':-index2*onesize}); } function m3(){ length3 = $('.slidepros3 li').length; $('.slidepros3 ul').css({'width':length*onesize}); $('.slidepros3 dd a').hover(function(){ index3 = $('.slidepros3 dd a').index($(this)); mt3(); }); } function run3(){ index3++; if(index3 == length3){ index3=0; } mt3(); } function mt3(){ $('.slidepros3 dd a').removeclass('current'); $('.slidepros3 dd a').eq(index3).addclass('current'); $('.slidepros3 ul').stop().animate({'left':-index3*onesize}); } function m4(){ length4 = $('.slidepros4 li').length; $('.slidepros4 ul').css({'width':length*onesize}); $('.slidepros4 dd a').hover(function(){ index4 = $('.slidepros4 dd a').index($(this)); mt4(); }); } function run4(){ index4++; if(index4 == length4){ index4=0; } mt4(); } function mt4(){ $('.slidepros4 dd a').removeclass('current'); $('.slidepros4 dd a').eq(index4).addclass('current'); $('.slidepros4 ul').stop().animate({'left':-index4*onesize}); } ///轮播图调用函数 var index=-1,length=0,length2,onesize=0,index2=-1,index3=-1,index4=-1; $(function(){ ///move('slidepros'); m(); m2(); m3(); m4(); var t1 = setinterval(function(){ run(); },3000); var t2 = setinterval(function(){ run2(); },2000); var t3 = setinterval(function(){ run3(); },3000); var t4 = setinterval(function(){ run4(); },999); }); function m(){ length = $('.slidepros li').length,onesize=$('.slidepros li:first').outerwidth(); $('.slidepros ul').css({'width':length*onesize}); $('.slidepros dd a').hover(function(){ index = $('.slidepros dd a').index($(this)); mt(); }); } function run(){ index++; if(index == length){ index=0; } mt(); } function mt(){ $('.slidepros dd a').removeclass('current'); $('.slidepros dd a').eq(index).addclass('current'); $('.slidepros ul').stop().animate({'left':-index*onesize}); }