/* superslide1.2 -- copyright ?2012 ����ϯ */ (function($){ $.fn.slide=function(options){ $.fn.slide.deflunt={ effect : "fade", //ч�� || fade�����ԣ� || top���ϲ�����|| left���������|| toploop����ѭ��������|| leftloop����ѭ��������|| topmarquee�����޷�ѭ��������|| leftmarquee�����޷�ѭ�������� autoplay:false, //�զ����� delaytime : 500, //ч������ʱ�� intertime : 2500,//�զ����м�����effectϊ�޷������ʱ���൱�������ٶȡ� defaultindex : 0,//ĭ�ϵĵ�ǰλ��������0�ǵ�һ�� titcell:".hd li",//����Ԫ�� maincell:".bd",//����Ԫ�صĸ������ trigger: "mouseover",//������ʽ || mouseover������ƹ�������|| click������������� scroll:1,//ÿ�ι��������� vis:1,//visible�����ӷ�χ�����������ݸ������ڿ��ӹ�����ʱ�򣬲�ִ��ч���� titonclassname:"on",//��ǰλ���զ����ӵ�class���� autopage:false,//ϵͳ�զ���ҳ����ϊtrueʱ��titcell��ϊ����Ԫ�ظ������ͬʱϵͳ����titcell�����զ������ҳliԪ��(1.2�汾����) prevcell:".prev",//ǰһ����ťԪ�ء� nextcell:".next"//��һ����ťԪ�ء� }; return this.each(function() { var opts = $.extend({},$.fn.slide.deflunt,options); var index=opts.defaultindex; var prevbtn = $(opts.prevcell, $(this)); var nextbtn = $(opts.nextcell, $(this)); var navobj = $(opts.titcell, $(this));//������Ԫ�ؽ�� var navobjsize = navobj.size(); var conbox = $(opts.maincell , $(this));//����Ԫ�ظ������ var conboxsize=conbox.children().size(); var slideh=0; var slidew=0; var selfw=0; var selfh=0; var autoplay = opts.autoplay; var inter=null;//setinterval���� var oldindex = index; if(conboxsize"+(i+1)+"") } var navobj = $("li", navobj);//���õ�����Ԫ�ض��� } conbox.children().each(function(){ //ȡ���ֵ if( $(this).width()>selfw ){ selfw=$(this).width(); slidew=$(this).outerwidth(true); } if( $(this).height()>selfh ){ selfh=$(this).height(); slideh=$(this).outerheight(true); } }); switch(opts.effect) { case "top": conbox.wrap('
').css( { "position":"relative","padding":"0","margin":"0"}).children().css( {"height":selfh} ); break; case "left": conbox.wrap('
').css( { "width":conboxsize*slidew,"position":"relative","overflow":"hidden","padding":"0","margin":"0"}).children().css( {"float":"left","width":selfw} ); break; case "leftloop": case "leftmarquee": conbox.children().clone().appendto(conbox).clone().prependto(conbox); conbox.wrap('
').css( { "width":conboxsize*slidew*3,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-conboxsize*slidew}).children().css( {"float":"left","width":selfw} ); break; case "toploop": case "topmarquee": conbox.children().clone().appendto(conbox).clone().prependto(conbox); conbox.wrap('
').css( { "height":conboxsize*slideh*3,"position":"relative","padding":"0","margin":"0","top":-conboxsize*slideh}).children().css( {"height":selfh} ); break; } //ч������ var doplay=function(){ switch(opts.effect) { case "fade": case "top": case "left": if ( index >= navobjsize) { index = 0; } else if( index < 0) { index = navobjsize-1; } break; case "leftmarquee":case "topmarquee": if ( index>= 2) { index=1; } else if( index<0) { index = 0; } break; case "leftloop": case "toploop": var tempnum = index - oldindex; if( navobjsize>2 && tempnum==-(navobjsize-1) ) tempnum=1; if( navobjsize>2 && tempnum==(navobjsize-1) ) tempnum=-1; var scrollnum = math.abs( tempnum*opts.scroll ); if ( index >= navobjsize) { index = 0; } else if( index < 0) { index = navobjsize-1; } break; } switch (opts.effect) { case "fade":conbox.children().stop(true,true).eq(index).fadein(opts.delaytime).siblings().hide();break; case "top":conbox.stop(true,true).animate({"top":-index*opts.scroll*slideh},opts.delaytime);break; case "left":conbox.stop(true,true).animate({"left":-index*opts.scroll*slidew},opts.delaytime);break; case "leftloop": if(tempnum<0 ){ conbox.stop(true,true).animate({"left":-(conboxsize-scrollnum )*slidew},opts.delaytime,function(){ for(var i=0;i= 0){ for(var i=0;i= 0){ for(var i=0;i