WordPress/wp-includes/js/jquery/ui/effect-shake.min.js

1 line
871 B
JavaScript
Raw Normal View History

!function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(y){return y.effects.effect.shake=function(e,t){var i,f=y(this),n=["position","top","bottom","left","right","height","width"],a=y.effects.setMode(f,e.mode||"effect"),o=e.direction||"left",s=e.distance||20,c=e.times||3,r=2*c+1,u=Math.round(e.duration/r),d="up"===o||"down"===o?"top":"left",p="up"===o||"left"===o,h={},m={},g={},l=f.queue(),q=l.length;for(y.effects.save(f,n),f.show(),y.effects.createWrapper(f),h[d]=(p?"-=":"+=")+s,m[d]=(p?"+=":"-=")+2*s,g[d]=(p?"-=":"+=")+2*s,f.animate(h,u,e.easing),i=1;i<c;i++)f.animate(m,u,e.easing).animate(g,u,e.easing);f.animate(m,u,e.easing).animate(h,u/2,e.easing).queue(function(){"hide"===a&&f.hide(),y.effects.restore(f,n),y.effects.removeWrapper(f),t()}),1<q&&l.splice.apply(l,[1,0].concat(l.splice(q,1+r))),f.dequeue()}});