/** ** ���ù������� ** ֧�ֶ�ʱ�զ��ֲ���ǰ���ֲ�����������ֲ� **/ (function($){ $("div[data-scro='controler'] b,div[data-scro='controler2'] a").click(function(){ var t = $(this); if(t.attr("class")=="down") return false; j2rolling_animation.st({ findobject : t, //��ǰ������� ĭ��д main : t.parent().parent().find("div[data-scro='list']"), //����ŀ���������ڶ��� pagsource : t.parent().parent().find("div[data-scro='controler'] b"), //�л���ť���� classname : "down", //ѡ�е���ʽ duration : "slow", //�����ٶ� ��jquery�ٶ�һ�� on : $(this)[0].tagname=="a" ? true : false //�����ж��ƿ������޹��� or �����л� }); return false; }); var j2settime="", j2time=true,j2rolling_animation = { init : function(){ this.start(); this.time(); }, st : function(o){ if(j2time){ this.animate(o.findobject,o.main,o.classname,o.duration,o.pagsource,o.on); j2time = false; } }, animate : function(t,m,c,s,p,o){ var _prevdown = o ? p.parent().find("*[class='"+c+"']") : t.parent().find(t[0].tagname+"[class='"+c+"']"), _previndex = _prevdown.index(), _thisindex = o ? (t.attr("class")=="next" ? _previndex+1 : _previndex-1) : t.index(), _list = m.find(".item"), p2n = 1; _prevdown.removeclass(c); if(o){ if(_thisindex==-1) _thisindex=_list.size()-1; if(_thisindex==_list.size()) _thisindex=0; p.eq(_thisindex).addclass(c); }else{ t.addclass(c); } if(t.attr("class")=="prev" || _thisindex<_previndex) p2n = false; if((t.attr("class")=="next" || _thisindex>_previndex)&&t.attr("class")!="prev") p2n = true; !p2n ? _list.eq(_thisindex).css("left",-m.width()) : ''; _list.eq(_previndex).animate({left:p2n ? -m.width() : m.width()},s,function(){ $(this).removeattr("style"); j2time = true; }); _list.eq(_thisindex).animate({left:"0px"},s); }, start : function(){ $("#section-focus-pic div[data-scro='controler'] b,#section-focus-pic div[data-scro='controler2'] a").mouseover(function(){ window.clearinterval(j2settime); }).mouseout(function(){ j2rolling_animation.time(); }); }, time : function(){ j2settime = window.setinterval(function(){ var num = $("#section-focus-pic div[data-scro='controler'] b[class='down']").index(), _list = $("#section-focus-pic div[data-scro='list'] li"); _list.eq(num).animate({"left":-$("#section-focus-pic div[data-scro='list']").width()},"slow",function(){ $(this).removeattr("style"); $("#section-focus-pic div[data-scro='controler'] b").removeclass("down").eq(num).addclass("down"); }); num++; if(num==_list.size()){ num=0; } _list.eq(num).animate({"left":"0px"},"slow"); },4000); } }; $("a").click(function(){ $(this).blur(); }); j2rolling_animation.init(); //�ƿ����զ��ֲ� })(this.jquery || this.baidu);