photomix/vendor/assets/javascripts/anythingslider/jquery.anythingslider.fx.min.js
2012-07-27 00:26:23 +04:00

6 lines
3.8 KiB
JavaScript

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