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

35 lines
1.8 KiB
JavaScript
Raw Normal View History

/*!
* jQuery UI Effects Bounce 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/bounce-effect/
*/
!function(a){"function"==typeof define&&define.amd?
// AMD. Register as an anonymous module.
define(["jquery","./effect"],a):
// Browser globals
a(jQuery)}(function(a){return a.effects.effect.bounce=function(b,c){var d,e,f,g=a(this),h=["position","top","bottom","left","right","height","width"],
// defaults:
i=a.effects.setMode(g,b.mode||"effect"),j="hide"===i,k="show"===i,l=b.direction||"up",m=b.distance,n=b.times||5,
// number of internal animations
o=2*n+(k||j?1:0),p=b.duration/o,q=b.easing,
// utility:
r="up"===l||"down"===l?"top":"left",s="up"===l||"left"===l,
// we will need to re-assemble the queue to stack our animations in place
t=g.queue(),u=t.length;
// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
for(
// Avoid touching opacity to prevent clearType and PNG issues in IE
(k||j)&&h.push("opacity"),a.effects.save(g,h),g.show(),a.effects.createWrapper(g),// Create Wrapper
// default distance for the BIGGEST bounce is the outer Distance / 3
m||(m=g["top"===r?"outerHeight":"outerWidth"]()/3),k&&(f={opacity:1},f[r]=0,g.css("opacity",0).css(r,s?2*-m:2*m).animate(f,p,q)),
// start at the smallest distance if we are hiding
j&&(m/=Math.pow(2,n-1)),f={},f[r]=0,d=0;n>d;d++)e={},e[r]=(s?"-=":"+=")+m,g.animate(e,p,q).animate(f,p,q),m=j?2*m:m/2;
// Last Bounce when Hiding
j&&(e={opacity:0},e[r]=(s?"-=":"+=")+m,g.animate(e,p,q)),g.queue(function(){j&&g.hide(),a.effects.restore(g,h),a.effects.removeWrapper(g),c()}),
// inject all the animations we just queued to be first in line (after "inprogress")
u>1&&t.splice.apply(t,[1,0].concat(t.splice(u,o+1))),g.dequeue()}});