/*! * superslide v2.0 * 轻松解决网站大部分特效展示问题 * 详尽信息请看官网:http://www.superslide2.com/ * * copyright 2011-2013, 大话主席 * * 请尊重原创,保留头部版权 * 在保留版权的前提下可应用于个人或商业用途 */ (function(a){a.fn.slide=function(b){return a.fn.slide.defaults={effect:"fade",autoplay:!1,delaytime:500,intertime:2500,triggertime:150,defaultindex:0,titcell:".hd li",maincell:".bd",targetcell:null,trigger:"mouseover",scroll:1,vis:1,titonclassname:"on",autopage:!1,prevcell:".prev",nextcell:".next",pagestatecell:".pagestate",opp:!1,pnloop:!0,easing:"linear",startfun:null,endfun:null,switchload:null},this.each(function(){var c=a.extend({},a.fn.slide.defaults,b),d=c.effect,e=a(c.prevcell,a(this)),f=a(c.nextcell,a(this)),g=a(c.pagestatecell,a(this)),h=a(c.titcell,a(this)),i=h.size(),j=a(c.maincell,a(this)),k=j.children().size(),l=c.switchload;if(null!=c.targetcell)var m=a(c.targetcell,a(this));var n=parseint(c.defaultindex),o=parseint(c.delaytime),p=parseint(c.intertime);parseint(c.triggertime);var r=parseint(c.scroll),s=parseint(c.vis),t="false"==c.autoplay||0==c.autoplay?!1:!0,u="false"==c.opp||0==c.opp?!1:!0,v="false"==c.autopage||0==c.autopage?!1:!0,w="false"==c.pnloop||0==c.pnloop?!1:!0,x=0,y=0,z=0,a=0,b=c.easing,c=null,d=n;if(0==i&&(i=k),v){var e=k-s;i=1+parseint(0!=e%r?e/r+1:e/r),0>=i&&(i=1),h.html("");for(var f=0;i>f;f++)h.append("
  • "+(f+1)+"
  • ");var h=a("li",h)}if(j.children().each(function(){a(this).width()>z&&(z=a(this).width(),y=a(this).outerwidth(!0)),a(this).height()>a&&(a=a(this).height(),x=a(this).outerheight(!0))}),k>=s)switch(d){case"fold":j.css({position:"relative",width:y,height:x}).children().css({position:"absolute",width:z,left:0,top:0,display:"none"});break;case"top":j.wrap('
    ').css({position:"relative",padding:"0",margin:"0"}).children().css({height:a});break;case"left":j.wrap('
    ').css({width:k*y,position:"relative",overflow:"hidden",padding:"0",margin:"0"}).children().css({"float":"left",width:z});break;case"leftloop":case"leftmarquee":j.children().clone().appendto(j).clone().prependto(j),j.wrap('
    ').css({width:3*k*y,position:"relative",overflow:"hidden",padding:"0",margin:"0",left:-k*y}).children().css({"float":"left",width:z});break;case"toploop":case"topmarquee":j.children().clone().appendto(j).clone().prependto(j),j.wrap('
    ').css({height:3*k*x,position:"relative",padding:"0",margin:"0",top:-k*x}).children().css({height:a})}var g=function(){a.isfunction(c.startfun)&&c.startfun(n,i)},h=function(){a.isfunction(c.endfun)&&c.endfun(n,i)},i=function(b){b.eq(n).find("img").each(function(){a(this).attr(l)!==void 0&&a(this).attr("src",a(this).attr(l)).removeattr(l)})},j=function(a){if(d!=n||a||"leftmarquee"==d||"topmarquee"==d){switch(d){case"fade":case"fold":case"top":case"left":n>=i?n=0:0>n&&(n=i-1);break;case"leftmarquee":case"topmarquee":n>=1?n=1:0>=n&&(n=0);break;case"leftloop":case"toploop":var b=n-d;i>2&&b==-(i-1)&&(b=1),i>2&&b==i-1&&(b=-1);var p=math.abs(b*r);n>=i?n=0:0>n&&(n=i-1)}if(g(),null!=l&&i(j.children()),m&&(null!=l&&i(m),m.hide().eq(n).animate({opacity:"show"},o,function(){j[0]||h()})),k>=s)switch(d){case"fade":j.children().stop(!0,!0).eq(n).animate({opacity:"show"},o,b,function(){h()}).siblings().hide();break;case"fold":j.children().stop(!0,!0).eq(n).animate({opacity:"show"},o,b,function(){h()}).siblings().animate({opacity:"hide"},o,b);break;case"top":j.stop(!0,!1).animate({top:-n*r*x},o,b,function(){h()});break;case"left":j.stop(!0,!1).animate({left:-n*r*y},o,b,function(){h()});break;case"leftloop":0>b?j.stop(!0,!0).animate({left:-(k-p)*y},o,b,function(){for(var a=0;p>a;a++)j.children().last().prependto(j);j.css("left",-k*y),h()}):j.stop(!0,!0).animate({left:-(k+p)*y},o,b,function(){for(var a=0;p>a;a++)j.children().first().appendto(j);j.css("left",-k*y),h()});break;case"toploop":0>b?j.stop(!0,!0).animate({top:-(k-p)*x},o,b,function(){for(var a=0;p>a;a++)j.children().last().prependto(j);j.css("top",-k*x),h()}):j.stop(!0,!0).animate({top:-(k+p)*x},o,b,function(){for(var a=0;p>a;a++)j.children().first().appendto(j);j.css("top",-k*x),h()});break;case"leftmarquee":var q=j.css("left").replace("px","");0==n?j.animate({left:++q},0,function(){if(j.css("left").replace("px","")>=0){for(var a=0;k>a;a++)j.children().last().prependto(j);j.css("left",-k*y)}}):j.animate({left:--q},0,function(){if(2*-k*y>=j.css("left").replace("px","")){for(var a=0;k>a;a++)j.children().first().appendto(j);j.css("left",-k*y)}});break;case"topmarquee":var t=j.css("top").replace("px","");0==n?j.animate({top:++t},0,function(){if(j.css("top").replace("px","")>=0){for(var a=0;k>a;a++)j.children().last().prependto(j);j.css("top",-k*x)}}):j.animate({top:--t},0,function(){if(2*-k*x>=j.css("top").replace("px","")){for(var a=0;k>a;a++)j.children().first().appendto(j);j.css("top",-k*x)}})}h.removeclass(c.titonclassname).eq(n).addclass(c.titonclassname),d=n,0==w&&(f.removeclass("nextstop"),e.removeclass("prevstop"),0==n?e.addclass("prevstop"):n==i-1&&f.addclass("nextstop")),g.html(""+(n+1)+"/"+i)}};j(!0),t&&("leftmarquee"==d||"topmarquee"==d?(u?n--:n++,c=setinterval(j,p),j.hover(function(){t&&clearinterval(c)},function(){t&&(clearinterval(c),c=setinterval(j,p))})):(c=setinterval(function(){u?n--:n++,j()},p),a(this).hover(function(){t&&clearinterval(c)},function(){t&&(clearinterval(c),c=setinterval(function(){u?n--:n++,j()},p))})));var k;"mouseover"==c.trigger?h.hover(function(){n=h.index(this),k=window.settimeout(j,c.triggertime)},function(){cleartimeout(k)}):h.click(function(){n=h.index(this),j()}),f.click(function(){(1==w||n!=i-1)&&(n++,j())}),e.click(function(){(1==w||0!=n)&&(n--,j())})})}})(jquery),jquery.easing.jswing=jquery.easing.swing,jquery.extend(jquery.easing,{def:"easeoutquad",swing:function(a,b,c,d,e){return jquery.easing[jquery.easing.def](a,b,c,d,e)},easeinquad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeoutquad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeinoutquad:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeincubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeoutcubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeinoutcubic:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeinquart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeoutquart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeinoutquart:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeinquint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeoutquint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeinoutquint:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeinsine:function(a,b,c,d,e){return-d*math.cos(b/e*(math.pi/2))+d+c},easeoutsine:function(a,b,c,d,e){return d*math.sin(b/e*(math.pi/2))+c},easeinoutsine:function(a,b,c,d,e){return-d/2*(math.cos(math.pi*b/e)-1)+c},easeinexpo:function(a,b,c,d,e){return 0==b?c:d*math.pow(2,10*(b/e-1))+c},easeoutexpo:function(a,b,c,d,e){return b==e?c+d:d*(-math.pow(2,-10*b/e)+1)+c},easeinoutexpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:1>(b/=e/2)?d/2*math.pow(2,10*(b-1))+c:d/2*(-math.pow(2,-10*--b)+2)+c},easeincirc:function(a,b,c,d,e){return-d*(math.sqrt(1-(b/=e)*b)-1)+c},easeoutcirc:function(a,b,c,d,e){return d*math.sqrt(1-(b=b/e-1)*b)+c},easeinoutcirc:function(a,b,c,d,e){return 1>(b/=e/2)?-d/2*(math.sqrt(1-b*b)-1)+c:d/2*(math.sqrt(1-(b-=2)*b)+1)+c},easeinelastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),math.abs(d)>h){h=d;var f=g/4}else var f=g/(2*math.pi)*math.asin(d/h);return-(h*math.pow(2,10*(b-=1))*math.sin((b*e-f)*2*math.pi/g))+c},easeoutelastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),math.abs(d)>h){h=d;var f=g/4}else var f=g/(2*math.pi)*math.asin(d/h);return h*math.pow(2,-10*b)*math.sin((b*e-f)*2*math.pi/g)+d+c},easeinoutelastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(2==(b/=e/2))return c+d;if(g||(g=e*.3*1.5),math.abs(d)>h){h=d;var f=g/4}else var f=g/(2*math.pi)*math.asin(d/h);return 1>b?-.5*h*math.pow(2,10*(b-=1))*math.sin((b*e-f)*2*math.pi/g)+c:.5*h*math.pow(2,-10*(b-=1))*math.sin((b*e-f)*2*math.pi/g)+d+c},easeinback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeoutback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeinoutback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),1>(b/=e/2)?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeinbounce:function(a,b,c,d,e){return d-jquery.easing.easeoutbounce(a,e-b,0,d,e)+c},easeoutbounce:function(a,b,c,d,e){return 1/2.75>(b/=e)?d*7.5625*b*b+c:2/2.75>b?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:2.5/2.75>b?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeinoutbounce:function(a,b,c,d,e){return e/2>b?.5*jquery.easing.easeinbounce(a,2*b,0,d,e)+c:.5*jquery.easing.easeoutbounce(a,2*b-e,0,d,e)+.5*d+c}});