2 * jQuery UI Effects 1.9pre
4 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 * Dual licensed under the MIT or GPL Version 2 licenses.
6 * http://jquery.org/license
8 * http://docs.jquery.com/UI/Effects/
10 ;jQuery.effects || (function($, undefined) {
12 var backCompat = $.uiBackCompat !== false;
18 /******************************************************************************/
19 /****************************** COLOR ANIMATIONS ******************************/
20 /******************************************************************************/
22 // override the animation for color styles
23 $.each(["backgroundColor", "borderBottomColor", "borderLeftColor",
24 "borderRightColor", "borderTopColor", "borderColor", "color", "outlineColor"],
26 $.fx.step[attr] = function(fx) {
28 fx.start = getColor(fx.elem, attr);
29 fx.end = getRGB(fx.end);
33 fx.elem.style[attr] = "rgb(" +
34 Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + "," +
35 Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + "," +
36 Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ")";
40 // Color Conversion functions from highlightFade
41 // By Blair Mitchelmore
42 // http://jquery.offput.ca/highlightFade/
44 // Parse strings looking for color tuples [255,255,255]
45 function getRGB(color) {
48 // Check if we're already dealing with an array of colors
49 if ( color && color.constructor === Array && color.length === 3 )
52 // Look for rgb(num,num,num)
53 if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
54 return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
56 // Look for rgb(num%,num%,num%)
57 if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
58 return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
61 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
62 return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
65 if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
66 return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
68 // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
69 if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
70 return colors["transparent"];
72 // Otherwise, we're most likely dealing with a named color
73 return colors[$.trim(color).toLowerCase()];
76 function getColor(elem, attr) {
80 color = $.curCSS(elem, attr);
82 // Keep going until we find an element that has color, or we hit the body
83 if ( color != "" && color !== "transparent" || $.nodeName(elem, "body") )
86 attr = "backgroundColor";
87 } while ( elem = elem.parentNode );
92 // Some named colors to work with
93 // From Interface by Stefan Petre
94 // http://interface.eyecon.ro/
105 darkcyan:[0,139,139],
106 darkgrey:[169,169,169],
108 darkkhaki:[189,183,107],
109 darkmagenta:[139,0,139],
110 darkolivegreen:[85,107,47],
111 darkorange:[255,140,0],
112 darkorchid:[153,50,204],
114 darksalmon:[233,150,122],
115 darkviolet:[148,0,211],
121 lightblue:[173,216,230],
122 lightcyan:[224,255,255],
123 lightgreen:[144,238,144],
124 lightgrey:[211,211,211],
125 lightpink:[255,182,193],
126 lightyellow:[255,255,224],
137 silver:[192,192,192],
140 transparent: [255,255,255]
145 /******************************************************************************/
146 /****************************** CLASS ANIMATIONS ******************************/
147 /******************************************************************************/
149 var classAnimationActions = [ "add", "remove", "toggle" ],
161 // prefix used for storing data on .data()
162 dataSpace = "ec.storage.";
164 $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
165 $.fx.step[ prop ] = function( fx ) {
166 if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
167 jQuery.style( fx.elem, prop, fx.end );
173 function getElementStyles() {
174 var style = this.ownerDocument.defaultView
175 ? this.ownerDocument.defaultView.getComputedStyle( this, null )
182 // webkit enumerates style porperties
183 if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
187 if ( typeof style[ key ] === "string" ) {
188 newStyle[ $.camelCase( key ) ] = style[ key ];
192 for ( key in style ) {
193 if ( typeof style[ key ] === "string" ) {
194 newStyle[ key ] = style[ key ];
203 function styleDifference( oldStyle, newStyle ) {
207 for ( name in newStyle ) {
208 value = newStyle[ name ];
209 if ( oldStyle[ name ] != value ) {
210 if ( !shorthandStyles[ name ] ) {
211 if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
212 diff[ name ] = value;
221 $.effects.animateClass = function( value, duration, easing, callback ) {
222 var o = $.speed( duration, easing, callback );
224 return this.queue( function() {
225 var animated = $( this ),
226 baseClass = animated.attr( "class" ) || "",
228 allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;
230 // map the animated objects to store the original styles.
231 allAnimations = allAnimations.map(function() {
235 originalStyleAttr: el.attr( "style" ) || " ",
236 start: getElementStyles.call( this )
240 // apply class change
241 $.each( classAnimationActions, function(i, action) {
242 if ( value[ action ] ) {
243 animated[ action + "Class" ]( value[ action ] );
246 finalClass = animated.attr( "class" );
248 // map all animated objects again - calculate new styles and diff
249 allAnimations = allAnimations.map(function() {
250 this.end = getElementStyles.call( this.el[ 0 ] );
251 this.diff = styleDifference( this.start, this.end );
255 // apply original class
256 animated.attr( "class", baseClass );
258 // map all animated objects again - this time collecting a promise
259 allAnimations = allAnimations.map(function() {
260 var styleInfo = this,
263 this.el.animate( this.diff, {
264 duration: o.duration,
267 complete: function() {
268 dfd.resolve( styleInfo );
271 return dfd.promise();
274 // once all animations have completed:
275 $.when.apply( $, allAnimations.get() ).done(function() {
277 // set the final class
278 animated.attr( "class", finalClass );
280 // for each animated element
281 $.each( arguments, function() {
282 if ( typeof this.el.attr( "style" ) === "object" ) {
283 this.el.attr( "style" ).cssText = "";
284 this.el.attr( "style" ).cssText = this.originalStyleAttr;
286 this.el.attr( "style", this.originalStyleAttr );
290 // this is guarnteed to be there if you use jQuery.speed()
291 // it also handles dequeuing the next anim...
292 o.complete.call( animated[ 0 ] );
298 _addClass: $.fn.addClass,
299 addClass: function( classNames, speed, easing, callback ) {
301 $.effects.animateClass.apply( this, [{ add: classNames }, speed, easing, callback ]) :
302 this._addClass(classNames);
305 _removeClass: $.fn.removeClass,
306 removeClass: function( classNames, speed, easing, callback ) {
308 $.effects.animateClass.apply( this, [{ remove: classNames }, speed, easing, callback ]) :
309 this._removeClass(classNames);
312 _toggleClass: $.fn.toggleClass,
313 toggleClass: function( classNames, force, speed, easing, callback ) {
314 if ( typeof force === "boolean" || force === undefined ) {
316 // without speed parameter;
317 return this._toggleClass( classNames, force );
319 return $.effects.animateClass.apply( this, [( force ? { add:classNames } : { remove:classNames }), speed, easing, callback ]);
322 // without force parameter;
323 return $.effects.animateClass.apply( this, [{ toggle: classNames }, force, speed, easing ]);
327 switchClass: function( remove, add, speed, easing, callback) {
328 return $.effects.animateClass.apply( this, [{
331 }, speed, easing, callback ]);
337 /******************************************************************************/
338 /*********************************** EFFECTS **********************************/
339 /******************************************************************************/
341 $.extend( $.effects, {
344 // Saves a set of properties in a data storage
345 save: function( element, set ) {
346 for( var i=0; i < set.length; i++ ) {
347 if ( set[ i ] !== null ) {
348 element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
353 // Restores a set of previously saved properties from a data storage
354 restore: function( element, set ) {
355 for( var i=0; i < set.length; i++ ) {
356 if ( set[ i ] !== null ) {
357 element.css( set[ i ], element.data( dataSpace + set[ i ] ) );
362 setMode: function( el, mode ) {
363 if (mode === "toggle") {
364 mode = el.is( ":hidden" ) ? "show" : "hide";
369 // Translates a [top,left] array into a baseline value
370 // this should be a little more flexible in the future to handle a string & hash
371 getBaseline: function( origin, original ) {
373 switch ( origin[ 0 ] ) {
374 case "top": y = 0; break;
375 case "middle": y = 0.5; break;
376 case "bottom": y = 1; break;
377 default: y = origin[ 0 ] / original.height;
379 switch ( origin[ 1 ] ) {
380 case "left": x = 0; break;
381 case "center": x = 0.5; break;
382 case "right": x = 1; break;
383 default: x = origin[ 1 ] / original.width;
391 // Wraps the element around a wrapper that copies position properties
392 createWrapper: function( element ) {
394 // if the element is already wrapped, return it
395 if ( element.parent().is( ".ui-effects-wrapper" )) {
396 return element.parent();
401 width: element.outerWidth(true),
402 height: element.outerHeight(true),
403 "float": element.css( "float" )
405 wrapper = $( "<div></div>" )
406 .addClass( "ui-effects-wrapper" )
409 background: "transparent",
414 // Store the size in case width/height are defined in % - Fixes #5245
416 width: element.width(),
417 height: element.height()
419 active = document.activeElement;
421 element.wrap( wrapper );
423 // Fixes #7595 - Elements lose focus when wrapped.
424 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
428 wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
430 // transfer positioning properties to the wrapper
431 if ( element.css( "position" ) === "static" ) {
432 wrapper.css({ position: "relative" });
433 element.css({ position: "relative" });
436 position: element.css( "position" ),
437 zIndex: element.css( "z-index" )
439 $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
440 props[ pos ] = element.css( pos );
441 if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
442 props[ pos ] = "auto";
446 position: "relative",
455 return wrapper.css( props ).show();
458 removeWrapper: function( element ) {
459 var active = document.activeElement;
461 if ( element.parent().is( ".ui-effects-wrapper" ) ) {
462 element.parent().replaceWith( element );
464 // Fixes #7595 - Elements lose focus when wrapped.
465 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
474 setTransition: function( element, list, factor, value ) {
476 $.each( list, function(i, x){
477 var unit = element.cssUnit( x );
478 if ( unit[ 0 ] > 0 ) value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
484 // return an effect options object for the given parameters:
485 function _normalizeArguments( effect, options, speed, callback ) {
487 // short path for passing an effect options object:
488 if ( $.isPlainObject( effect ) ) {
492 // convert to an object
493 effect = { effect: effect };
496 if ( options === undefined ) {
500 // catch (effect, callback)
501 if ( $.isFunction( options ) ) {
507 // catch (effect, speed, ?)
508 if ( $.type( options ) === "number" || $.fx.speeds[ options ]) {
514 // catch (effect, options, callback)
515 if ( $.isFunction( speed ) ) {
520 // add options to effect
522 $.extend( effect, options );
525 speed = speed || options.duration;
526 effect.duration = $.fx.off ? 0 : typeof speed === "number"
527 ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
529 effect.complete = callback || options.complete;
534 function standardSpeed( speed ) {
535 // valid standard speeds
536 if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
540 // invalid strings - treat as "normal" speed
541 if ( typeof speed === "string" && !$.effects.effect[ speed ] ) {
542 // TODO: remove in 2.0 (#7115)
543 if ( backCompat && $.effects[ speed ] ) {
553 effect: function( effect, options, speed, callback ) {
554 var args = _normalizeArguments.apply( this, arguments ),
557 effectMethod = $.effects.effect[ args.effect ],
559 // DEPRECATED: remove in 2.0 (#7115)
560 oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ];
562 if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
563 // delegate to the original method (e.g., .show()) if possible
565 return this[ mode ]( args.duration, args.complete );
567 return this.each( function() {
568 if ( args.complete ) {
569 args.complete.call( this );
575 function run( next ) {
576 var elem = $( this ),
577 complete = args.complete,
581 if ( $.isFunction( complete ) ) {
582 complete.call( elem[0] );
584 if ( $.isFunction( next ) ) {
589 // if the element is hiddden and mode is hide,
590 // or element is visible and mode is show
591 if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
594 effectMethod.call( elem[0], args, done );
598 // TODO: remove this check in 2.0, effectMethod will always be true
599 if ( effectMethod ) {
600 return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
602 // DEPRECATED: remove in 2.0 (#7115)
603 return oldEffectMethod.call(this, {
605 duration: args.duration,
606 callback: args.complete,
613 show: function( speed ) {
614 if ( standardSpeed( speed ) ) {
615 return this._show.apply( this, arguments );
617 var args = _normalizeArguments.apply( this, arguments );
619 return this.effect.call( this, args );
624 hide: function( speed ) {
625 if ( standardSpeed( speed ) ) {
626 return this._hide.apply( this, arguments );
628 var args = _normalizeArguments.apply( this, arguments );
630 return this.effect.call( this, args );
634 // jQuery core overloads toggle and creates _toggle
635 __toggle: $.fn.toggle,
636 toggle: function( speed ) {
637 if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
638 return this.__toggle.apply( this, arguments );
640 var args = _normalizeArguments.apply( this, arguments );
641 args.mode = "toggle";
642 return this.effect.call( this, args );
647 cssUnit: function(key) {
648 var style = this.css( key ),
651 $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
652 if ( style.indexOf( unit ) > 0 )
653 val = [ parseFloat( style ), unit ];
661 /******************************************************************************/
662 /*********************************** EASING ***********************************/
663 /******************************************************************************/
666 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
668 * Uses the built in easing capabilities added In jQuery 1.1
669 * to offer multiple easing options
671 * TERMS OF USE - jQuery Easing
673 * Open source under the BSD License.
675 * Copyright 2008 George McGinley Smith
676 * All rights reserved.
678 * Redistribution and use in source and binary forms, with or without modification,
679 * are permitted provided that the following conditions are met:
681 * Redistributions of source code must retain the above copyright notice, this list of
682 * conditions and the following disclaimer.
683 * Redistributions in binary form must reproduce the above copyright notice, this list
684 * of conditions and the following disclaimer in the documentation and/or other materials
685 * provided with the distribution.
687 * Neither the name of the author nor the names of contributors may be used to endorse
688 * or promote products derived from this software without specific prior written permission.
690 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
691 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
692 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
693 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
694 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
695 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
696 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
697 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
698 * OF THE POSSIBILITY OF SUCH DAMAGE.
702 // t: current time, b: begInnIng value, c: change In value, d: duration
703 $.easing.jswing = $.easing.swing;
705 $.extend( $.easing, {
707 swing: function ( x, t, b, c, d ) {
708 return $.easing[ $.easing.def ]( x, t, b, c, d );
710 easeInQuad: function ( x, t, b, c, d ) {
711 return c * ( t /= d ) * t + b;
713 easeOutQuad: function ( x, t, b, c, d ) {
714 return -c * ( t /= d ) * ( t - 2 ) + b;
716 easeInOutQuad: function ( x, t, b, c, d ) {
717 if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t + b;
718 return -c / 2 * ( ( --t ) * ( t-2 ) - 1) + b;
720 easeInCubic: function ( x, t, b, c, d ) {
721 return c * ( t /= d ) * t * t + b;
723 easeOutCubic: function ( x, t, b, c, d ) {
724 return c * ( ( t = t / d - 1 ) * t * t + 1 ) + b;
726 easeInOutCubic: function ( x, t, b, c, d ) {
727 if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t + b;
728 return c / 2 * ( ( t -= 2 ) * t * t + 2) + b;
730 easeInQuart: function ( x, t, b, c, d ) {
731 return c * ( t /= d ) * t * t * t + b;
733 easeOutQuart: function ( x, t, b, c, d ) {
734 return -c * ( ( t = t / d - 1 ) * t * t * t - 1) + b;
736 easeInOutQuart: function ( x, t, b, c, d ) {
737 if ( (t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t + b;
738 return -c / 2 * ( ( t -= 2 ) * t * t * t - 2) + b;
740 easeInQuint: function ( x, t, b, c, d ) {
741 return c * ( t /= d ) * t * t * t * t + b;
743 easeOutQuint: function ( x, t, b, c, d ) {
744 return c * ( ( t = t / d - 1 ) * t * t * t * t + 1) + b;
746 easeInOutQuint: function ( x, t, b, c, d ) {
747 if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t * t + b;
748 return c / 2 * ( ( t -= 2 ) * t * t * t * t + 2) + b;
750 easeInSine: function ( x, t, b, c, d ) {
751 return -c * Math.cos( t / d * ( Math.PI / 2 ) ) + c + b;
753 easeOutSine: function ( x, t, b, c, d ) {
754 return c * Math.sin( t / d * ( Math.PI /2 ) ) + b;
756 easeInOutSine: function ( x, t, b, c, d ) {
757 return -c / 2 * ( Math.cos( Math.PI * t / d ) - 1 ) + b;
759 easeInExpo: function ( x, t, b, c, d ) {
760 return ( t==0 ) ? b : c * Math.pow( 2, 10 * ( t / d - 1) ) + b;
762 easeOutExpo: function ( x, t, b, c, d ) {
763 return ( t==d ) ? b + c : c * ( -Math.pow( 2, -10 * t / d) + 1) + b;
765 easeInOutExpo: function ( x, t, b, c, d ) {
766 if ( t==0 ) return b;
767 if ( t==d ) return b + c;
768 if ( ( t /= d / 2) < 1) return c / 2 * Math.pow( 2, 10 * (t - 1) ) + b;
769 return c / 2 * ( -Math.pow( 2, -10 * --t ) + 2 ) + b;
771 easeInCirc: function ( x, t, b, c, d ) {
772 return -c * ( Math.sqrt( 1 - ( t /= d ) * t ) - 1 ) + b;
774 easeOutCirc: function ( x, t, b, c, d ) {
775 return c * Math.sqrt( 1 - ( t = t / d - 1 ) * t ) + b;
777 easeInOutCirc: function ( x, t, b, c, d ) {
778 if ( ( t /= d / 2) < 1 ) return -c / 2 * ( Math.sqrt( 1 - t * t ) - 1 ) + b;
779 return c / 2 * ( Math.sqrt( 1 - ( t -= 2 ) * t ) + 1 ) + b;
781 easeInElastic: function ( x, t, b, c, d ) {
785 if ( t == 0 ) return b;
786 if ( ( t /= d ) == 1 ) return b+c;
787 if ( a < Math.abs( c ) ) {
791 s = p / ( 2 * Math.PI ) * Math.asin( c / a );
793 return - ( a * Math.pow( 2, 10 * ( t -= 1 ) ) * Math.sin( ( t * d - s) * ( 2 * Math.PI ) / p ) ) + b;
795 easeOutElastic: function ( x, t, b, c, d ) {
799 if ( t == 0 ) return b;
800 if ( ( t /= d ) == 1 ) return b+c;
801 if ( a < Math.abs( c ) ) {
805 s = p / ( 2 * Math.PI ) * Math.asin( c / a );
807 return a * Math.pow( 2, -10 * t ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) + c + b;
809 easeInOutElastic: function ( x, t, b, c, d ) {
811 p = d * ( 0.3 * 1.5 ),
813 if ( t == 0 ) return b;
814 if ( ( t /= d / 2 ) == 2 ) return b+c;
815 if ( a < Math.abs( c ) ) {
819 s = p / ( 2 * Math.PI ) * Math.asin( c / a );
821 if ( t < 1 ) return -.5 * ( a * Math.pow( 2, 10 * ( t -= 1 ) ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) ) + b;
822 return a * Math.pow( 2, -10 * ( t -= 1 ) ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) *.5 + c + b;
824 easeInBack: function ( x, t, b, c, d, s ) {
825 if ( s == undefined ) s = 1.70158;
826 return c * ( t /= d ) * t * ( ( s+1 ) * t - s ) + b;
828 easeOutBack: function ( x, t, b, c, d, s ) {
829 if ( s == undefined ) s = 1.70158;
830 return c * ( ( t = t / d - 1 ) * t * ( ( s + 1 ) * t + s) + 1) + b;
832 easeInOutBack: function ( x, t, b, c, d, s ) {
833 if ( s == undefined ) s = 1.70158;
834 if ( ( t /= d / 2 ) < 1 ) return c / 2 * ( t * t * ( ( ( s *= 1.525 ) + 1 ) * t - s ) ) + b;
835 return c / 2 * ( ( t -= 2 ) * t * ( ( ( s *= 1.525 ) + 1 ) * t + s) + 2) + b;
837 easeInBounce: function ( x, t, b, c, d ) {
838 return c - $.easing.easeOutBounce( x, d - t, 0, c, d ) + b;
840 easeOutBounce: function ( x, t, b, c, d ) {
841 if ( ( t /= d ) < ( 1 / 2.75 ) ) {
842 return c * ( 7.5625 * t * t ) + b;
843 } else if ( t < ( 2 / 2.75 ) ) {
844 return c * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + .75 ) + b;
845 } else if ( t < ( 2.5 / 2.75 ) ) {
846 return c * ( 7.5625 * ( t -= ( 2.25/ 2.75 ) ) * t + .9375 ) + b;
848 return c * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + .984375 ) + b;
851 easeInOutBounce: function ( x, t, b, c, d ) {
852 if ( t < d / 2 ) return $.easing.easeInBounce( x, t * 2, 0, c, d ) * .5 + b;
853 return $.easing.easeOutBounce( x, t * 2 - d, 0, c, d ) * .5 + c * .5 + b;
859 * TERMS OF USE - EASING EQUATIONS
861 * Open source under the BSD License.
863 * Copyright 2001 Robert Penner
864 * All rights reserved.
866 * Redistribution and use in source and binary forms, with or without modification,
867 * are permitted provided that the following conditions are met:
869 * Redistributions of source code must retain the above copyright notice, this list of
870 * conditions and the following disclaimer.
871 * Redistributions in binary form must reproduce the above copyright notice, this list
872 * of conditions and the following disclaimer in the documentation and/or other materials
873 * provided with the distribution.
875 * Neither the name of the author nor the names of contributors may be used to endorse
876 * or promote products derived from this software without specific prior written permission.
878 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
879 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
880 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
881 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
882 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
883 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
884 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
885 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
886 * OF THE POSSIBILITY OF SUCH DAMAGE.