2014-10-07 17:28:24 +02:00
|
|
|
/*!
|
2015-03-11 16:12:27 +01:00
|
|
|
* jQuery UI Effects Bounce 1.11.4
|
2014-10-07 17:28:24 +02:00
|
|
|
* http://jqueryui.com
|
|
|
|
*
|
2015-02-27 11:21:26 +01:00
|
|
|
* Copyright jQuery Foundation and other contributors
|
2014-10-07 17:28:24 +02:00
|
|
|
* Released under the MIT license.
|
|
|
|
* http://jquery.org/license
|
|
|
|
*
|
|
|
|
* http://api.jqueryui.com/bounce-effect/
|
|
|
|
*/
|
2015-11-05 18:47:30 +01:00
|
|
|
!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()}});
|