/*! * superslide v2.1.3 * 轻松解决网站大部分特效展示问题 * 详尽信息请看官网:http://www.superslide2.com/ * * copyright 2011-至今, 大话主席 * * 请尊重原创,保留头部版权 * 在保留版权的前提下可应用于个人或商业用途 * v2.1.3:处理jquery已经弃用的api,兼容最新版本的jquery,目前是jquery3.3.1,日后如果发现插件不兼容新版本的jquery,请联系我 305491515@qq.com */ !function(a){a.fn.slide=function(b){return a.fn.slide.defaults={type:"slide",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:"swing",startfun:null,endfun:null,switchload:null,playstatecell:".playstate",mouseoverstop:!0,defaultplay:!0,returndefault:!1},this.each(function(){var t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,c=a.extend({},a.fn.slide.defaults,b),d=a(this),e=c.effect,f=a(c.prevcell,d),g=a(c.nextcell,d),h=a(c.pagestatecell,d),i=a(c.playstatecell,d),j=a(c.titcell,d),k=j.length,l=a(c.maincell,d),m=l.children().length,n=c.switchload,o=a(c.targetcell,d),p=parseint(c.defaultindex),q=parseint(c.delaytime),r=parseint(c.intertime);if(parseint(c.triggertime),t=parseint(c.scroll),u="false"==c.autoplay||0==c.autoplay?!1:!0,v="false"==c.opp||0==c.opp?!1:!0,w="false"==c.autopage||0==c.autopage?!1:!0,x="false"==c.pnloop||0==c.pnloop?!1:!0,y="false"==c.mouseoverstop||0==c.mouseoverstop?!1:!0,z="false"==c.defaultplay||0==c.defaultplay?!1:!0,a="false"==c.returndefault||0==c.returndefault?!1:!0,b=isnan(c.vis)?1:parseint(c.vis),c=!-[1]&&!window.xmlhttprequest,d=0,e=0,f=0,g=0,h=c.easing,i=null,j=null,k=null,l=c.titonclassname,m=j.index(d.find("."+l)),n=p=-1==m?p:m,o=p,p=p,q=m>=b?0!=m%t?m%t:t:0,s="leftmarquee"==e||"topmarquee"==e?!0:!1,t=function(){a.isfunction(c.startfun)&&c.startfun(p,k,d,a(c.titcell,d),l,o,f,g)},u=function(){a.isfunction(c.endfun)&&c.endfun(p,k,d,a(c.titcell,d),l,o,f,g)},v=function(){j.removeclass(l),z&&j.eq(o).addclass(l)},"menu"==c.type)return z&&j.removeclass(l).eq(p).addclass(l),j.hover(function(){r=a(this).find(c.targetcell);var b=j.index(a(this));j=settimeout(function(){switch(p=b,j.removeclass(l).eq(p).addclass(l),t(),e){case"fade":r.stop(!0,!0).animate({opacity:"show"},q,h,u);break;case"slidedown":r.stop(!0,!0).animate({height:"show"},q,h,u)}},c.triggertime)},function(){switch(cleartimeout(j),e){case"fade":r.animate({opacity:"hide"},q,h);break;case"slidedown":r.animate({height:"hide"},q,h)}}),a&&d.hover(function(){cleartimeout(k)},function(){k=settimeout(v,q)}),void 0;if(0==k&&(k=m),s&&(k=2),w){if(m>=b?"leftloop"==e||"toploop"==e?k=0!=m%t?(0^m/t)+1:m/t:(w=m-b,k=1+parseint(0!=w%t?w/t+1:w/t),0>=k&&(k=1)):k=1,j.html(""),x="",1==c.autopage||"true"==c.autopage)for(y=0;k>y;y++)x+="
  • "+(y+1)+"
  • ";else for(y=0;k>y;y++)x+=c.autopage.replace("$",y+1);j.html(x),j=j.children()}if(m>=b)switch(l.children().each(function(){a(this).width()>f&&(f=a(this).width(),e=a(this).outerwidth(!0)),a(this).height()>g&&(g=a(this).height(),d=a(this).outerheight(!0))}),z=l.children(),$=function(){var a;for(a=0;b>a;a++)z.eq(a).clone().addclass("clone").appendto(l);for(a=0;q>a;a++)z.eq(m-a-1).clone().addclass("clone").prependto(l)},e){case"fold":l.css({position:"relative",width:e,height:d}).children().css({position:"absolute",width:f,left:0,top:0,display:"none"});break;case"top":l.wrap('
    ').css({top:-(p*t)*d,position:"relative",padding:"0",margin:"0"}).children().css({height:g});break;case"left":l.wrap('
    ').css({width:m*e,left:-(p*t)*e,position:"relative",overflow:"hidden",padding:"0",margin:"0"}).children().css({"float":"left",width:f});break;case"leftloop":case"leftmarquee":$(),l.wrap('
    ').css({width:(m+b+q)*e,position:"relative",overflow:"hidden",padding:"0",margin:"0",left:-(q+p*t)*e}).children().css({"float":"left",width:f});break;case"toploop":case"topmarquee":$(),l.wrap('
    ').css({height:(m+b+q)*d,position:"relative",padding:"0",margin:"0",top:-(q+p*t)*d}).children().css({height:g})}_=function(a){var b=a*t;return a==k?b=m:-1==a&&0!=m%t&&(b=-m%t),b},ab=function(b){var d,f,g,h,c=function(c){for(var d=c;b+c>d;d++)b.eq(d).find("img["+n+"]").each(function(){var c,d,b=a(this);if(b.attr("src",b.attr(n)).removeattr(n),l.find(".clone")[0])for(c=l.children(),d=0;d=1?p=1:0>=p&&(p=0):(p=p,p>=k?p=0:0>p&&(p=k-1)),t(),null!=n&&ab(l.children()),o[0]&&(r=o.eq(p),null!=n&&ab(o),"slidedown"==e?(o.not(r).stop(!0,!0).slideup(q),r.slidedown(q,h,function(){l[0]||u()})):(o.not(r).stop(!0,!0).hide(),r.animate({opacity:"show"},q,function(){l[0]||u()}))),m>=b)switch(e){case"fade":l.children().stop(!0,!0).eq(p).animate({opacity:"show"},q,h,function(){u()}).siblings().hide();break;case"fold":l.children().stop(!0,!0).eq(p).animate({opacity:"show"},q,h,function(){u()}).siblings().animate({opacity:"hide"},q,h);break;case"top":l.stop(!0,!1).animate({top:-p*t*d},q,h,function(){u()});break;case"left":l.stop(!0,!1).animate({left:-p*t*e},q,h,function(){u()});break;case"leftloop":b=p,l.stop(!0,!0).animate({left:-(_(p)+q)*e},q,h,function(){-1>=b?l.css("left",-(q+(k-1)*t)*e):b>=k&&l.css("left",-q*e),u()});break;case"toploop":b=p,l.stop(!0,!0).animate({top:-(_(p)+q)*d},q,h,function(){-1>=b?l.css("top",-(q+(k-1)*t)*d):b>=k&&l.css("top",-q*d),u()});break;case"leftmarquee":c=l.css("left").replace("px",""),0==p?l.animate({left:++c},0,function(){l.css("left").replace("px","")>=0&&l.css("left",-m*e)}):l.animate({left:--c},0,function(){l.css("left").replace("px","")<=-(m+q)*e&&l.css("left",-q*e)});break;case"topmarquee":d=l.css("top").replace("px",""),0==p?l.animate({top:++d},0,function(){l.css("top").replace("px","")>=0&&l.css("top",-m*d)}):l.animate({top:--d},0,function(){l.css("top").replace("px","")<=-(m+q)*d&&l.css("top",-q*d)})}j.removeclass(l).eq(p).addclass(l),n=p,x||(g.removeclass("nextstop"),f.removeclass("prevstop"),0==p&&f.addclass("prevstop"),p==k-1&&g.addclass("nextstop")),h.html(""+(p+1)+"/"+k)}},z&&bb(!0),a&&d.hover(function(){cleartimeout(k)},function(){k=settimeout(function(){p=o,z?bb():"slidedown"==e?r.slideup(q,v):r.animate({opacity:"hide"},q,v),n=p},300)}),cb=function(a){i=setinterval(function(){v?p--:p++,bb()},a?a:r)},db=function(a){i=setinterval(bb,a?a:r)},eb=function(){y||!u||i.hasclass("pausestate")||(clearinterval(i),cb())},fb=function(){(x||p!=k-1)&&(p++,bb(),s||eb())},gb=function(){(x||0!=p)&&(p--,bb(),s||eb())},hb=function(){clearinterval(i),s?db():cb(),i.removeclass("pausestate")},ib=function(){clearinterval(i),i.addclass("pausestate")},u?s?(v?p--:p++,db(),y&&l.hover(ib,hb)):(cb(),y&&d.hover(ib,hb)):(s&&(v?p--:p++),i.addclass("pausestate")),i.click(function(){i.hasclass("pausestate")?hb():ib()}),"mouseover"==c.trigger?j.hover(function(){var a=j.index(this);j=settimeout(function(){p=a,bb(),eb()},c.triggertime)},function(){cleartimeout(j)}):j.click(function(){p=j.index(this),bb(),eb()}),s?(g.mousedown(fb),f.mousedown(gb),x&&(kb=function(){jb=settimeout(function(){clearinterval(i),db(0^r/10)},150)},lb=function(){cleartimeout(jb),clearinterval(i),db()},g.mousedown(kb),g.mouseup(lb),f.mousedown(kb),f.mouseup(lb)),"mouseover"==c.trigger&&(g.hover(fb,function(){}),f.hover(gb,function(){}))):(g.click(fb),f.click(gb)),"auto"!=c.vis||1!=t||"left"!=e&&"leftloop"!=e||(nb=function(){c&&(l.width("auto"),l.children().width("auto")),l.parent().width("auto"),e=l.parent().width(),c&&l.parent().width(e),l.children().width(e),"left"==e?(l.width(e*m),l.stop(!0,!1).animate({left:-p*e},0)):(l.width(e*(m+2)),l.stop(!0,!1).animate({left:-(p+1)*e},0)),c||e==l.parent().width()||nb()},a(window).resize(function(){cleartimeout(mb),mb=settimeout(nb,100)}),nb())})}}(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(b/=e/2)<1?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(b/=e/2)<1?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(b/=e/2)<1?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(b/=e/2)<1?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:(b/=e/2)<1?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(b/=e/2)<1?-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;return 0==b?c:1==(b/=e)?c+d:(g||(g=.3*e),hb?-.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),(b/=e/2)<1?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(b/=e)<1/2.75?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}}); /* wjdhcms.com by2.0 */ (function ($) { var nivoslider = function (element, options) { var settings = $.extend({}, $.fn.nivoslider.defaults, options); var vars = { currentslide: 0, currentimage: '', totalslides: 0, randanim: '', running: false, paused: false, stop: false }; var slider = $(element); slider.data('nivo:vars', vars); slider.css('position', 'relative'); slider.addclass('nivoslider'); var kids = slider.children(); kids.each(function () { var child = $(this); var link = ''; if (!child.is('img')) { if (child.is('a')) { child.addclass('nivo-imagelink'); link = child; } child = child.find('img:first'); } var childwidth = child.width(); if (childwidth == 0) childwidth = child.attr('width'); var childheight = child.height(); if (childheight == 0) childheight = child.attr('height'); if (childwidth > slider.width()) { slider.width(childwidth); } if (childheight > slider.height()) { slider.height(childheight); } if (link != '') { link.css('display', 'none'); } child.css('display', 'none'); vars.totalslides++; }); if (settings.startslide > 0) { if (settings.startslide >= vars.totalslides) settings.startslide = vars.totalslides - 1; vars.currentslide = settings.startslide; } if ($(kids[vars.currentslide]).is('img')) { vars.currentimage = $(kids[vars.currentslide]); } else { vars.currentimage = $(kids[vars.currentslide]).find('img:first'); } if ($(kids[vars.currentslide]).is('a')) { $(kids[vars.currentslide]).css('display', 'block'); } slider.css('background', 'url("' + vars.currentimage.attr('src') + '") center no-repeat'); slider.append($('

    ').css({ display: 'none', opacity: settings.captionopacity })); var processcaption = function (settings) { var nivocaption = $('.nivo-caption', slider); if (vars.currentimage.attr('title') != '' && vars.currentimage.attr('title') != undefined) { var title = vars.currentimage.attr('title'); if (title.substr(0, 1) == '#') title = $(title).html(); if (nivocaption.css('display') == 'block') { nivocaption.find('p').fadeout(settings.animspeed, function () { $(this).html(title); $(this).fadein(settings.animspeed); }); } else { nivocaption.find('p').html(title); } nivocaption.fadein(settings.animspeed); } else { nivocaption.fadeout(settings.animspeed); } } processcaption(settings); var timer = 0; if (!settings.manualadvance && kids.length > 1) { timer = setinterval(function () { nivorun(slider, kids, settings, false); }, settings.pausetime); } if (settings.directionnav) { slider.append(''); if (settings.directionnavhide) { $('.nivo-directionnav', slider).hide(); slider.hover(function () { $('.nivo-directionnav', slider).show(); }, function () { $('.nivo-directionnav', slider).hide(); }); } $('a.nivo-prevnav', slider).live('click', function () { if (vars.running) return false; clearinterval(timer); timer = ''; vars.currentslide -= 2; nivorun(slider, kids, settings, 'prev'); }); $('a.nivo-nextnav', slider).live('click', function () { if (vars.running) return false; clearinterval(timer); timer = ''; nivorun(slider, kids, settings, 'next'); }); } if (settings.controlnav) { var nivocontrol = $('
    '); slider.append(nivocontrol); for (var i = 0; i < kids.length; i++) { if (settings.controlnavthumbs) { var child = kids.eq(i); if (!child.is('img')) { child = child.find('img:first'); } if (settings.controlnavthumbsfromrel) { nivocontrol.append(''); } else { nivocontrol.append(''); } } else { nivocontrol.append('' + (i + 1) + ''); } } $('.nivo-controlnav a:eq(' + vars.currentslide + ')', slider).addclass('active'); $('.nivo-controlnav a', slider).live('click', function () { if (vars.running) return false; if ($(this).hasclass('active')) return false; clearinterval(timer); timer = ''; slider.css('background', 'url("' + vars.currentimage.attr('src') + '") no-repeat'); vars.currentslide = $(this).attr('rel') - 1; nivorun(slider, kids, settings, 'control'); }); } if (settings.keyboardnav) { $(window).keypress(function (event) { if (event.keycode == '37') { if (vars.running) return false; clearinterval(timer); timer = ''; vars.currentslide -= 2; nivorun(slider, kids, settings, 'prev'); } if (event.keycode == '39') { if (vars.running) return false; clearinterval(timer); timer = ''; nivorun(slider, kids, settings, 'next'); } }); } if (settings.pauseonhover) { slider.hover(function () { vars.paused = true; clearinterval(timer); timer = ''; }, function () { vars.paused = false; if (timer == '' && !settings.manualadvance) { timer = setinterval(function () { nivorun(slider, kids, settings, false); }, settings.pausetime); } }); } slider.bind('nivo:animfinished', function () { vars.running = false; $(kids).each(function () { if ($(this).is('a')) { $(this).css('display', 'none'); } }); if ($(kids[vars.currentslide]).is('a')) { $(kids[vars.currentslide]).css('display', 'block'); } if (timer == '' && !vars.paused && !settings.manualadvance) { timer = setinterval(function () { nivorun(slider, kids, settings, false); }, settings.pausetime); } settings.afterchange.call(this); }); var createslices = function (slider, settings, vars) { for (var i = 0; i < settings.slices; i++) { var slicewidth = math.round(slider.width() / settings.slices); if (i == settings.slices - 1) { slider.append($('
    ').css({ left: (slicewidth * i) + 'px', width: (slider.width() - (slicewidth * i)) + 'px', height: '0px', opacity: '0', background: 'url("' + vars.currentimage.attr('src') + '") no-repeat -' + ((slicewidth + (i * slicewidth)) - slicewidth) + 'px 0%' })); } else { slider.append($('
    ').css({ left: (slicewidth * i) + 'px', width: slicewidth + 'px', height: '0px', opacity: '0', background: 'url("' + vars.currentimage.attr('src') + '") no-repeat -' + ((slicewidth + (i * slicewidth)) - slicewidth) + 'px 0%' })); } } } var createboxes = function (slider, settings, vars) { var boxwidth = math.round(slider.width() / settings.boxcols); var boxheight = math.round(slider.height() / settings.boxrows); for (var rows = 0; rows < settings.boxrows; rows++) { for (var cols = 0; cols < settings.boxcols; cols++) { if (cols == settings.boxcols - 1) { slider.append($('
    ').css({ opacity: 0, left: (boxwidth * cols) + 'px', top: (boxheight * rows) + 'px', width: (slider.width() - (boxwidth * cols)) + 'px', height: boxheight + 'px', background: 'url("' + vars.currentimage.attr('src') + '") no-repeat -' + ((boxwidth + (cols * boxwidth)) - boxwidth) + 'px -' + ((boxheight + (rows * boxheight)) - boxheight) + 'px' })); } else { slider.append($('
    ').css({ opacity: 0, left: (boxwidth * cols) + 'px', top: (boxheight * rows) + 'px', width: boxwidth + 'px', height: boxheight + 'px', background: 'url("' + vars.currentimage.attr('src') + '") no-repeat -' + ((boxwidth + (cols * boxwidth)) - boxwidth) + 'px -' + ((boxheight + (rows * boxheight)) - boxheight) + 'px' })); } } } } var nivorun = function (slider, kids, settings, nudge) { var vars = slider.data('nivo:vars'); if (vars && (vars.currentslide == vars.totalslides - 1)) { settings.lastslide.call(this); } if ((!vars || vars.stop) && !nudge) return false; settings.beforechange.call(this); if (!nudge) { slider.css('background', 'url("' + vars.currentimage.attr('src') + '") no-repeat'); } else { if (nudge == 'prev') { slider.css('background', 'url("' + vars.currentimage.attr('src') + '") no-repeat'); } if (nudge == 'next') { slider.css('background', 'url("' + vars.currentimage.attr('src') + '") no-repeat'); } } vars.currentslide++; if (vars.currentslide == vars.totalslides) { vars.currentslide = 0; settings.slideshowend.call(this); } if (vars.currentslide < 0) vars.currentslide = (vars.totalslides - 1); if ($(kids[vars.currentslide]).is('img')) { vars.currentimage = $(kids[vars.currentslide]); } else { vars.currentimage = $(kids[vars.currentslide]).find('img:first'); } if (settings.controlnav) { $('.nivo-controlnav a', slider).removeclass('active'); $('.nivo-controlnav a:eq(' + vars.currentslide + ')', slider).addclass('active'); } processcaption(settings); $('.nivo-slice', slider).remove(); $('.nivo-box', slider).remove(); if (settings.effect == 'random') { var anims = new array('slicedownright', 'slicedownleft', 'sliceupright', 'sliceupleft', 'sliceupdown', 'sliceupdownleft', 'fold', 'fade', 'boxrandom', 'boxrain', 'boxrainreverse', 'boxraingrow', 'boxraingrowreverse'); vars.randanim = anims[math.floor(math.random() * (anims.length + 1))]; if (vars.randanim == undefined) vars.randanim = 'fade'; } if (settings.effect.indexof(',') != -1) { var anims = settings.effect.split(','); vars.randanim = anims[math.floor(math.random() * (anims.length))]; if (vars.randanim == undefined) vars.randanim = 'fade'; } vars.running = true; if (settings.effect == 'slicedown' || settings.effect == 'slicedownright' || vars.randanim == 'slicedownright' || settings.effect == 'slicedownleft' || vars.randanim == 'slicedownleft') { createslices(slider, settings, vars); var timebuff = 0; var i = 0; var slices = $('.nivo-slice', slider); if (settings.effect == 'slicedownleft' || vars.randanim == 'slicedownleft') slices = $('.nivo-slice', slider)._reverse(); slices.each(function () { var slice = $(this); slice.css({ 'top': '0px' }); if (i == settings.slices - 1) { settimeout(function () { slice.animate({ height: '100%', opacity: '1.0' }, settings.animspeed, '', function () { slider.trigger('nivo:animfinished'); }); }, (100 + timebuff)); } else { settimeout(function () { slice.animate({ height: '100%', opacity: '1.0' }, settings.animspeed); }, (100 + timebuff)); } timebuff += 50; i++; }); } else if (settings.effect == 'sliceup' || settings.effect == 'sliceupright' || vars.randanim == 'sliceupright' || settings.effect == 'sliceupleft' || vars.randanim == 'sliceupleft') { createslices(slider, settings, vars); var timebuff = 0; var i = 0; var slices = $('.nivo-slice', slider); if (settings.effect == 'sliceupleft' || vars.randanim == 'sliceupleft') slices = $('.nivo-slice', slider)._reverse(); slices.each(function () { var slice = $(this); slice.css({ 'bottom': '0px' }); if (i == settings.slices - 1) { settimeout(function () { slice.animate({ height: '100%', opacity: '1.0' }, settings.animspeed, '', function () { slider.trigger('nivo:animfinished'); }); }, (100 + timebuff)); } else { settimeout(function () { slice.animate({ height: '100%', opacity: '1.0' }, settings.animspeed); }, (100 + timebuff)); } timebuff += 50; i++; }); } else if (settings.effect == 'sliceupdown' || settings.effect == 'sliceupdownright' || vars.randanim == 'sliceupdown' || settings.effect == 'sliceupdownleft' || vars.randanim == 'sliceupdownleft') { createslices(slider, settings, vars); var timebuff = 0; var i = 0; var v = 0; var slices = $('.nivo-slice', slider); if (settings.effect == 'sliceupdownleft' || vars.randanim == 'sliceupdownleft') slices = $('.nivo-slice', slider)._reverse(); slices.each(function () { var slice = $(this); if (i == 0) { slice.css('top', '0px'); i++; } else { slice.css('bottom', '0px'); i = 0; } if (v == settings.slices - 1) { settimeout(function () { slice.animate({ height: '100%', opacity: '1.0' }, settings.animspeed, '', function () { slider.trigger('nivo:animfinished'); }); }, (100 + timebuff)); } else { settimeout(function () { slice.animate({ height: '100%', opacity: '1.0' }, settings.animspeed); }, (100 + timebuff)); } timebuff += 50; v++; }); } else if (settings.effect == 'fold' || vars.randanim == 'fold') { createslices(slider, settings, vars); var timebuff = 0; var i = 0; $('.nivo-slice', slider).each(function () { var slice = $(this); var origwidth = slice.width(); slice.css({ top: '0px', height: '100%', width: '0px' }); if (i == settings.slices - 1) { settimeout(function () { slice.animate({ width: origwidth, opacity: '1.0' }, settings.animspeed, '', function () { slider.trigger('nivo:animfinished'); }); }, (100 + timebuff)); } else { settimeout(function () { slice.animate({ width: origwidth, opacity: '1.0' }, settings.animspeed); }, (100 + timebuff)); } timebuff += 50; i++; }); } else if (settings.effect == 'fade' || vars.randanim == 'fade') { createslices(slider, settings, vars); var firstslice = $('.nivo-slice:first', slider); firstslice.css({ 'height': '100%', 'width': slider.width() + 'px' }); firstslice.animate({ opacity: '1.0' }, (settings.animspeed * 2), '', function () { slider.trigger('nivo:animfinished'); }); } else if (settings.effect == 'slideinright' || vars.randanim == 'slideinright') { createslices(slider, settings, vars); var firstslice = $('.nivo-slice:first', slider); firstslice.css({ 'height': '100%', 'width': '0px', 'opacity': '1' }); firstslice.animate({ width: slider.width() + 'px' }, (settings.animspeed * 2), '', function () { slider.trigger('nivo:animfinished'); }); } else if (settings.effect == 'slideinleft' || vars.randanim == 'slideinleft') { createslices(slider, settings, vars); var firstslice = $('.nivo-slice:first', slider); firstslice.css({ 'height': '100%', 'width': '0px', 'opacity': '1', 'left': '', 'right': '0px' }); firstslice.animate({ width: slider.width() + 'px' }, (settings.animspeed * 2), '', function () { firstslice.css({ 'left': '0px', 'right': '' }); slider.trigger('nivo:animfinished'); }); } else if (settings.effect == 'boxrandom' || vars.randanim == 'boxrandom') { createboxes(slider, settings, vars); var totalboxes = settings.boxcols * settings.boxrows; var i = 0; var timebuff = 0; var boxes = shuffle($('.nivo-box', slider)); boxes.each(function () { var box = $(this); if (i == totalboxes - 1) { settimeout(function () { box.animate({ opacity: '1' }, settings.animspeed, '', function () { slider.trigger('nivo:animfinished'); }); }, (100 + timebuff)); } else { settimeout(function () { box.animate({ opacity: '1' }, settings.animspeed); }, (100 + timebuff)); } timebuff += 20; i++; }); } else if (settings.effect == 'boxrain' || vars.randanim == 'boxrain' || settings.effect == 'boxrainreverse' || vars.randanim == 'boxrainreverse' || settings.effect == 'boxraingrow' || vars.randanim == 'boxraingrow' || settings.effect == 'boxraingrowreverse' || vars.randanim == 'boxraingrowreverse') { createboxes(slider, settings, vars); var totalboxes = settings.boxcols * settings.boxrows; var i = 0; var timebuff = 0; var rowindex = 0; var colindex = 0; var box2darr = new array(); box2darr[rowindex] = new array(); var boxes = $('.nivo-box', slider); if (settings.effect == 'boxrainreverse' || vars.randanim == 'boxrainreverse' || settings.effect == 'boxraingrowreverse' || vars.randanim == 'boxraingrowreverse') { boxes = $('.nivo-box', slider)._reverse(); } boxes.each(function () { box2darr[rowindex][colindex] = $(this); colindex++; if (colindex == settings.boxcols) { rowindex++; colindex = 0; box2darr[rowindex] = new array(); } }); for (var cols = 0; cols < (settings.boxcols * 2); cols++) { var prevcol = cols; for (var rows = 0; rows < settings.boxrows; rows++) { if (prevcol >= 0 && prevcol < settings.boxcols) { (function (row, col, time, i, totalboxes) { var box = $(box2darr[row][col]); var w = box.width(); var h = box.height(); if (settings.effect == 'boxraingrow' || vars.randanim == 'boxraingrow' || settings.effect == 'boxraingrowreverse' || vars.randanim == 'boxraingrowreverse') { box.width(0).height(0); } if (i == totalboxes - 1) { settimeout(function () { box.animate({ opacity: '1', width: w, height: h }, settings.animspeed / 1.3, '', function () { slider.trigger('nivo:animfinished'); }); }, (100 + time)); } else { settimeout(function () { box.animate({ opacity: '1', width: w, height: h }, settings.animspeed / 1.3); }, (100 + time)); } })(rows, prevcol, timebuff, i, totalboxes); i++; } prevcol--; } timebuff += 100; } } } var shuffle = function (arr) { for (var j, x, i = arr.length; i; j = parseint(math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); return arr; } var trace = function (msg) { if (this.console && typeof console.log != "undefined") console.log(msg); } this.stop = function () { if (!$(element).data('nivo:vars').stop) { $(element).data('nivo:vars').stop = true; trace('stop slider'); } } this.start = function () { if ($(element).data('nivo:vars').stop) { $(element).data('nivo:vars').stop = false; trace('start slider'); } } settings.afterload.call(this); return this; }; $.fn.nivoslider = function (options) { return this.each(function (key, value) { var element = $(this); if (element.data('nivoslider')) return element.data('nivoslider'); var nivoslider = new nivoslider(this, options); element.data('nivoslider', nivoslider); }); }; $.fn.nivoslider.defaults = { effect: 'random', slices: 15, boxcols: 8, boxrows: 4, animspeed: 500, pausetime: 3000, startslide: 0, directionnav: true, directionnavhide: true, controlnav: true, controlnavthumbs: false, controlnavthumbsfromrel: false, controlnavthumbssearch: '.jpg', controlnavthumbsreplace: '_thumb.jpg', keyboardnav: true, pauseonhover: true, manualadvance: false, captionopacity: 0.8, prevtext: 'prev', nexttext: 'next', beforechange: function () { }, afterchange: function () { }, slideshowend: function () { }, lastslide: function () { }, afterload: function () { } }; $.fn._reverse = [].reverse; })(jquery);