9 lines
813 B
JavaScript
9 lines
813 B
JavaScript
/*!
|
|
* jQuery UI Effects Shake 1.13.3
|
|
* https://jqueryui.com
|
|
*
|
|
* Copyright OpenJS Foundation and other contributors
|
|
* Released under the MIT license.
|
|
* https://jquery.org/license
|
|
*/
|
|
(e=>{"function"==typeof define&&define.amd?define(["jquery","../version","../effect"],e):e(jQuery)})(function(h){return h.effects.define("shake",function(e,n){var t=1,i=h(this),a=e.direction||"left",f=e.distance||20,u=e.times||3,s=2*u+1,o=Math.round(e.duration/s),r="up"===a||"down"===a?"top":"left",a="up"===a||"left"===a,c={},d={},m={},g=i.queue().length;for(h.effects.createPlaceholder(i),c[r]=(a?"-=":"+=")+f,d[r]=(a?"+=":"-=")+2*f,m[r]=(a?"-=":"+=")+2*f,i.animate(c,o,e.easing);t<u;t++)i.animate(d,o,e.easing).animate(m,o,e.easing);i.animate(d,o,e.easing).animate(c,o/2,e.easing).queue(n),h.effects.unshift(i,g,1+s)})}); |