jquery.anythingslider.fx.min.js 3.4 KB

123456
  1. /*
  2. * AnythingSlider Slide FX 1.5.7 minified for AnythingSlider v1.7.11+
  3. * By Rob Garrison (aka Mottie & Fudgey)
  4. * Dual licensed under the MIT and GPL licenses.
  5. */
  6. (function(i){i.fn.anythingSliderFx=function(q,r){var n=i(this).closest(".anythingSlider"),g=n.width(),o=n.height(),p=function(c){var a=c,l;c&&typeof c==="string"&&c.indexOf(",")>0&&(c=c.split(","),a=i.trim(c[0]),l=i.trim(c[1]));return{top:[{inFx:{top:0},outFx:{top:"-"+(a||o)}}],bottom:[{inFx:{top:0},outFx:{top:a||o}}],left:[{inFx:{left:0},outFx:{left:"-"+(a||g)}}],right:[{inFx:{left:0},outFx:{left:a||g}}],fade:[{inFx:{opacity:a||1},outFx:{opacity:0}}],expand:[{inFx:{width:l||"100%",height:l||"100%", top:"0%",left:"0%"},outFx:{width:a||"10%",height:a||"10%",top:"50%",left:"50%"}}],grow:[{inFx:{top:0,fontSize:a||"16px",opacity:1},outFx:{top:"-200px",fontSize:l||"80px",opacity:0}}],listLR:[{inFx:{left:0,opacity:1},outFx:[{left:a||g,opacity:0},{left:"-"+(a||g),opacity:0}],selector:[":odd",":even"]}],listRL:[{inFx:{left:0,opacity:1},outFx:[{left:a||g,opacity:0},{left:"-"+(a||g),opacity:0}],selector:[":even",":odd"]}],"caption-Top":[{inFx:{top:0,opacity:0.8},outFx:{top:"-"+a||-50,opacity:0}}],"caption-Right":[{inFx:{right:0, opacity:0.8},outFx:{right:"-"+a||-150,opacity:0}}],"caption-Bottom":[{inFx:{bottom:0,opacity:0.8},outFx:{bottom:"-"+a||-50,opacity:0}}],"caption-Left":[{inFx:{left:0,opacity:0.8},outFx:{left:"-"+a||-150,opacity:0}}]}};return this.each(function(){i(this).data("AnythingSlider").fx=q;var c=i.extend({easing:"swing",timeIn:400,timeOut:350,stopRepeat:!1,outFxBind:"slide_init",inFxBind:"slide_complete"},r),a=p(),l=function(a,b,e,c){if(!(a.length===0||typeof b==="undefined")){var d=b[0]||b,f=d[1]||"",c=c|| parseInt(f===""?d.duration:d[0].duration,10);if(e&&(a.css("position")!=="absolute"&&a.css({position:"relative"}),a.stop(),f!=="")){a.filter(b[1][0]).animate(d[0],{queue:!1,duration:c,easing:d[0].easing});a.filter(b[1][1]).animate(f,{queue:!0,duration:c,easing:d[0].easing});return}a.animate(d,{queue:!0,duration:c,easing:d.easing})}},g=function(k,b){var e,j=b?"outFx":"inFx",d={},f=b?c.timeOut:c.timeIn,h=i.trim(k[0].replace(/\s+/g," ")).split(" ");if(b&&h.length===1&&a.hasOwnProperty(h)&&typeof a[h][0].selector!== "undefined")return e=a[h][0].outFx,e[0].duration=k[2]||c.timeOut,e[0].easing=k[3]||c.easing,[e,a[h][0].selector||[]];i.each(h,function(e,h){if(a.hasOwnProperty(h)){var g=typeof k[1]==="undefined"||k[1]==="",g=g?a:p(k[1]);i.extend(!0,d,g[h][0][j]);g=k[2]||d.duration||f;d.duration=b?g/2:g;d.easing=isNaN(k[3])?k[3]||c.easing:k[4]||c.easing}});return[d]},m=i(this).bind(c.outFxBind,function(a,b){if(!(c.stopRepeat&&b.$lastPage[0]===b.$targetPage[0])){var e,j,d,f=b.$lastPage.add(b.$items.eq(b.exactPage)).add(b.$targetPage), h=b.fx;b.exactPage===0&&(f=f.add(b.$items.eq(b.pages)));b.options.animationTime<c.timeOut&&(d=b.options.animationTime||c.timeOut);f=f.find("*").andSelf();for(e in h)if(e==="outFx")for(j in h.outFx)f.filter(j).length&&l(f.filter(j),h.outFx[j],!0);else e!=="inFx"&&i.isArray(h[e])&&f.filter(e).length&&l(f.filter(e),g(h[e],!0),!0,d)}}).bind(c.inFxBind,function(a,b){if(!(c.stopRepeat&&b.$lastPage[0]===b.$targetPage[0])){var e,j,d=b.$currentPage.add(b.$items.eq(b.exactPage)),f=b.fx,d=d.find("*").andSelf(); for(e in f)if(e==="inFx")for(j in f.inFx)d.filter(j).length&&l(d.filter(j),f.inFx[j],!1);else e!=="outFx"&&i.isArray(f[e])&&d.filter(e).length&&l(d.filter(e),g(f[e],!1),!1)}}).data("AnythingSlider");i(window).load(function(){m.gotoPage(m.currentPage,m.playing)})})}})(jQuery);