blob: 0dd4b7545a0deabd86758463210eaef60bd73deb [file] [log] [blame]
!function(a,b){function c(a){return a.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()}function d(a){return e?e+a:a.toLowerCase()}var e,f,g,h,i,j,k,l,m,n,o="",p={Webkit:"webkit",Moz:"",O:"o"},q=document.createElement("div"),r=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,s={};a.each(p,function(a,c){if(q.style[a+"TransitionProperty"]!==b)return o="-"+a.toLowerCase()+"-",e=c,!1}),f=o+"transform",s[g=o+"transition-property"]=s[h=o+"transition-duration"]=s[j=o+"transition-delay"]=s[i=o+"transition-timing-function"]=s[k=o+"animation-name"]=s[l=o+"animation-duration"]=s[n=o+"animation-delay"]=s[m=o+"animation-timing-function"]="",a.fx={off:e===b&&q.style.transitionProperty===b,speeds:{_default:400,fast:200,slow:600},cssPrefix:o,transitionEnd:d("TransitionEnd"),animationEnd:d("AnimationEnd")},a.fn.animate=function(c,d,e,f,g){return a.isFunction(d)&&(f=d,e=b,d=b),a.isFunction(e)&&(f=e,e=b),a.isPlainObject(d)&&(e=d.easing,f=d.complete,g=d.delay,d=d.duration),d&&(d=("number"==typeof d?d:a.fx.speeds[d]||a.fx.speeds._default)/1e3),g&&(g=parseFloat(g)/1e3),this.anim(c,d,e,f,g)},a.fn.anim=function(d,e,o,p,q){var t,u,v,w={},x="",y=this,z=a.fx.transitionEnd,A=!1;if(e===b&&(e=a.fx.speeds._default/1e3),q===b&&(q=0),a.fx.off&&(e=0),"string"==typeof d)w[k]=d,w[l]=e+"s",w[n]=q+"s",w[m]=o||"linear",z=a.fx.animationEnd;else{u=[];for(t in d)r.test(t)?x+=t+"("+d[t]+") ":(w[t]=d[t],u.push(c(t)));x&&(w[f]=x,u.push(f)),e>0&&"object"==typeof d&&(w[g]=u.join(", "),w[h]=e+"s",w[j]=q+"s",w[i]=o||"linear")}return v=function(b){if("undefined"!=typeof b){if(b.target!==b.currentTarget)return;a(b.target).unbind(z,v)}else a(this).unbind(z,v);A=!0,a(this).css(s),p&&p.call(this)},e>0&&(this.bind(z,v),setTimeout(function(){A||v.call(y)},1e3*(e+q)+25)),this.size()&&this.get(0).clientLeft,this.css(w),e<=0&&setTimeout(function(){y.each(function(){v.call(this)})},0),this},q=null}(Zepto);