2 * jQuery UI Effects 1.8
\r
4 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
\r
5 * Dual licensed under the MIT (MIT-LICENSE.txt)
\r
6 * and GPL (GPL-LICENSE.txt) licenses.
\r
8 * http://docs.jquery.com/UI/Effects/
\r
10 ;jQuery.effects || (function($) {
\r
16 /******************************************************************************/
\r
17 /****************************** COLOR ANIMATIONS ******************************/
\r
18 /******************************************************************************/
\r
20 // override the animation for color styles
\r
21 $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
\r
22 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'],
\r
24 $.fx.step[attr] = function(fx) {
\r
25 if (!fx.colorInit) {
\r
26 fx.start = getColor(fx.elem, attr);
\r
27 fx.end = getRGB(fx.end);
\r
28 fx.colorInit = true;
\r
31 fx.elem.style[attr] = 'rgb(' +
\r
32 Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +
\r
33 Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +
\r
34 Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';
\r
38 // Color Conversion functions from highlightFade
\r
39 // By Blair Mitchelmore
\r
40 // http://jquery.offput.ca/highlightFade/
\r
42 // Parse strings looking for color tuples [255,255,255]
\r
43 function getRGB(color) {
\r
46 // Check if we're already dealing with an array of colors
\r
47 if ( color && color.constructor == Array && color.length == 3 )
\r
50 // Look for rgb(num,num,num)
\r
51 if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
\r
52 return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
\r
54 // Look for rgb(num%,num%,num%)
\r
55 if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
\r
56 return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
\r
59 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
\r
60 return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
\r
63 if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
\r
64 return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
\r
66 // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
\r
67 if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
\r
68 return colors['transparent'];
\r
70 // Otherwise, we're most likely dealing with a named color
\r
71 return colors[$.trim(color).toLowerCase()];
\r
74 function getColor(elem, attr) {
\r
78 color = $.curCSS(elem, attr);
\r
80 // Keep going until we find an element that has color, or we hit the body
\r
81 if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
\r
84 attr = "backgroundColor";
\r
85 } while ( elem = elem.parentNode );
\r
87 return getRGB(color);
\r
90 // Some named colors to work with
\r
91 // From Interface by Stefan Petre
\r
92 // http://interface.eyecon.ro/
\r
96 azure:[240,255,255],
\r
97 beige:[245,245,220],
\r
102 darkblue:[0,0,139],
\r
103 darkcyan:[0,139,139],
\r
104 darkgrey:[169,169,169],
\r
105 darkgreen:[0,100,0],
\r
106 darkkhaki:[189,183,107],
\r
107 darkmagenta:[139,0,139],
\r
108 darkolivegreen:[85,107,47],
\r
109 darkorange:[255,140,0],
\r
110 darkorchid:[153,50,204],
\r
112 darksalmon:[233,150,122],
\r
113 darkviolet:[148,0,211],
\r
114 fuchsia:[255,0,255],
\r
118 khaki:[240,230,140],
\r
119 lightblue:[173,216,230],
\r
120 lightcyan:[224,255,255],
\r
121 lightgreen:[144,238,144],
\r
122 lightgrey:[211,211,211],
\r
123 lightpink:[255,182,193],
\r
124 lightyellow:[255,255,224],
\r
126 magenta:[255,0,255],
\r
130 orange:[255,165,0],
\r
131 pink:[255,192,203],
\r
132 purple:[128,0,128],
\r
133 violet:[128,0,128],
\r
135 silver:[192,192,192],
\r
136 white:[255,255,255],
\r
137 yellow:[255,255,0],
\r
138 transparent: [255,255,255]
\r
143 /******************************************************************************/
\r
144 /****************************** CLASS ANIMATIONS ******************************/
\r
145 /******************************************************************************/
\r
147 var classAnimationActions = ['add', 'remove', 'toggle'],
\r
148 shorthandStyles = {
\r
160 function getElementStyles() {
\r
161 var style = document.defaultView
\r
162 ? document.defaultView.getComputedStyle(this, null)
\r
163 : this.currentStyle,
\r
168 // webkit enumerates style porperties
\r
169 if (style && style.length && style[0] && style[style[0]]) {
\r
170 var len = style.length;
\r
173 if (typeof style[key] == 'string') {
\r
174 camelCase = key.replace(/\-(\w)/g, function(all, letter){
\r
175 return letter.toUpperCase();
\r
177 newStyle[camelCase] = style[key];
\r
181 for (key in style) {
\r
182 if (typeof style[key] === 'string') {
\r
183 newStyle[key] = style[key];
\r
191 function filterStyles(styles) {
\r
193 for (name in styles) {
\r
194 value = styles[name];
\r
196 // ignore null and undefined values
\r
198 // ignore functions (when does this occur?)
\r
199 $.isFunction(value) ||
\r
200 // shorthand styles that need to be expanded
\r
201 name in shorthandStyles ||
\r
202 // ignore scrollbars (break in IE)
\r
203 (/scrollbar/).test(name) ||
\r
205 // only colors or values that can be converted to numbers
\r
206 (!(/color/i).test(name) && isNaN(parseFloat(value)))
\r
208 delete styles[name];
\r
215 function styleDifference(oldStyle, newStyle) {
\r
216 var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459
\r
219 for (name in newStyle) {
\r
220 if (oldStyle[name] != newStyle[name]) {
\r
221 diff[name] = newStyle[name];
\r
228 $.effects.animateClass = function(value, duration, easing, callback) {
\r
229 if ($.isFunction(easing)) {
\r
234 return this.each(function() {
\r
236 var that = $(this),
\r
237 originalStyleAttr = that.attr('style') || ' ',
\r
238 originalStyle = filterStyles(getElementStyles.call(this)),
\r
240 className = that.attr('className');
\r
242 $.each(classAnimationActions, function(i, action) {
\r
243 if (value[action]) {
\r
244 that[action + 'Class'](value[action]);
\r
247 newStyle = filterStyles(getElementStyles.call(this));
\r
248 that.attr('className', className);
\r
250 that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() {
\r
251 $.each(classAnimationActions, function(i, action) {
\r
252 if (value[action]) { that[action + 'Class'](value[action]); }
\r
254 // work around bug in IE by clearing the cssText before setting it
\r
255 if (typeof that.attr('style') == 'object') {
\r
256 that.attr('style').cssText = '';
\r
257 that.attr('style').cssText = originalStyleAttr;
\r
259 that.attr('style', originalStyleAttr);
\r
261 if (callback) { callback.apply(this, arguments); }
\r
267 _addClass: $.fn.addClass,
\r
268 addClass: function(classNames, speed, easing, callback) {
\r
269 return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
\r
272 _removeClass: $.fn.removeClass,
\r
273 removeClass: function(classNames,speed,easing,callback) {
\r
274 return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
\r
277 _toggleClass: $.fn.toggleClass,
\r
278 toggleClass: function(classNames, force, speed, easing, callback) {
\r
279 if ( typeof force == "boolean" || force === undefined ) {
\r
281 // without speed parameter;
\r
282 return this._toggleClass(classNames, force);
\r
284 return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);
\r
287 // without switch parameter;
\r
288 return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);
\r
292 switchClass: function(remove,add,speed,easing,callback) {
\r
293 return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
\r
299 /******************************************************************************/
\r
300 /*********************************** EFFECTS **********************************/
\r
301 /******************************************************************************/
\r
303 $.extend($.effects, {
\r
306 // Saves a set of properties in a data storage
\r
307 save: function(element, set) {
\r
308 for(var i=0; i < set.length; i++) {
\r
309 if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
\r
313 // Restores a set of previously saved properties from a data storage
\r
314 restore: function(element, set) {
\r
315 for(var i=0; i < set.length; i++) {
\r
316 if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
\r
320 setMode: function(el, mode) {
\r
321 if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
\r
325 getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
\r
326 // this should be a little more flexible in the future to handle a string & hash
\r
328 switch (origin[0]) {
\r
329 case 'top': y = 0; break;
\r
330 case 'middle': y = 0.5; break;
\r
331 case 'bottom': y = 1; break;
\r
332 default: y = origin[0] / original.height;
\r
334 switch (origin[1]) {
\r
335 case 'left': x = 0; break;
\r
336 case 'center': x = 0.5; break;
\r
337 case 'right': x = 1; break;
\r
338 default: x = origin[1] / original.width;
\r
340 return {x: x, y: y};
\r
343 // Wraps the element around a wrapper that copies position properties
\r
344 createWrapper: function(element) {
\r
346 // if the element is already wrapped, return it
\r
347 if (element.parent().is('.ui-effects-wrapper')) {
\r
348 return element.parent();
\r
351 // wrap the element
\r
353 width: element.outerWidth(true),
\r
354 height: element.outerHeight(true),
\r
355 'float': element.css('float')
\r
357 wrapper = $('<div></div>')
\r
358 .addClass('ui-effects-wrapper')
\r
361 background: 'transparent',
\r
367 element.wrap(wrapper);
\r
368 wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
\r
370 // transfer positioning properties to the wrapper
\r
371 if (element.css('position') == 'static') {
\r
372 wrapper.css({ position: 'relative' });
\r
373 element.css({ position: 'relative' });
\r
376 position: element.css('position'),
\r
377 zIndex: element.css('z-index')
\r
379 $.each(['top', 'left', 'bottom', 'right'], function(i, pos) {
\r
380 props[pos] = element.css(pos);
\r
381 if (isNaN(parseInt(props[pos], 10))) {
\r
382 props[pos] = 'auto';
\r
385 element.css({position: 'relative', top: 0, left: 0 });
\r
388 return wrapper.css(props).show();
\r
391 removeWrapper: function(element) {
\r
392 if (element.parent().is('.ui-effects-wrapper'))
\r
393 return element.parent().replaceWith(element);
\r
397 setTransition: function(element, list, factor, value) {
\r
398 value = value || {};
\r
399 $.each(list, function(i, x){
\r
400 unit = element.cssUnit(x);
\r
401 if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
\r
408 function _normalizeArguments(effect, options, speed, callback) {
\r
409 // shift params for method overloading
\r
410 if (typeof effect == 'object') {
\r
411 callback = options;
\r
414 effect = options.effect;
\r
416 if ($.isFunction(options)) {
\r
417 callback = options;
\r
421 if ($.isFunction(speed)) {
\r
425 if (typeof options == 'number' || $.fx.speeds[options]) {
\r
431 options = options || {};
\r
433 speed = speed || options.duration;
\r
434 speed = $.fx.off ? 0 : typeof speed == 'number'
\r
435 ? speed : $.fx.speeds[speed] || $.fx.speeds._default;
\r
437 callback = callback || options.complete;
\r
439 return [effect, options, speed, callback];
\r
443 effect: function(effect, options, speed, callback) {
\r
444 var args = _normalizeArguments.apply(this, arguments),
\r
445 // TODO: make effects takes actual parameters instead of a hash
\r
451 effectMethod = $.effects[effect];
\r
453 return effectMethod && !$.fx.off ? effectMethod.call(this, args2) : this;
\r
457 show: function(speed) {
\r
458 if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) {
\r
459 return this._show.apply(this, arguments);
\r
461 var args = _normalizeArguments.apply(this, arguments);
\r
462 args[1].mode = 'show';
\r
463 return this.effect.apply(this, args);
\r
468 hide: function(speed) {
\r
469 if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) {
\r
470 return this._hide.apply(this, arguments);
\r
472 var args = _normalizeArguments.apply(this, arguments);
\r
473 args[1].mode = 'hide';
\r
474 return this.effect.apply(this, args);
\r
478 // jQuery core overloads toggle and create _toggle
\r
479 __toggle: $.fn.toggle,
\r
480 toggle: function(speed) {
\r
481 if (!speed || typeof speed == 'number' || $.fx.speeds[speed] ||
\r
482 typeof speed == 'boolean' || $.isFunction(speed)) {
\r
483 return this.__toggle.apply(this, arguments);
\r
485 var args = _normalizeArguments.apply(this, arguments);
\r
486 args[1].mode = 'toggle';
\r
487 return this.effect.apply(this, args);
\r
491 // helper functions
\r
492 cssUnit: function(key) {
\r
493 var style = this.css(key), val = [];
\r
494 $.each( ['em','px','%','pt'], function(i, unit){
\r
495 if(style.indexOf(unit) > 0)
\r
496 val = [parseFloat(style), unit];
\r
504 /******************************************************************************/
\r
505 /*********************************** EASING ***********************************/
\r
506 /******************************************************************************/
\r
509 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
\r
511 * Uses the built in easing capabilities added In jQuery 1.1
\r
512 * to offer multiple easing options
\r
514 * TERMS OF USE - jQuery Easing
\r
516 * Open source under the BSD License.
\r
518 * Copyright 2008 George McGinley Smith
\r
519 * All rights reserved.
\r
521 * Redistribution and use in source and binary forms, with or without modification,
\r
522 * are permitted provided that the following conditions are met:
\r
524 * Redistributions of source code must retain the above copyright notice, this list of
\r
525 * conditions and the following disclaimer.
\r
526 * Redistributions in binary form must reproduce the above copyright notice, this list
\r
527 * of conditions and the following disclaimer in the documentation and/or other materials
\r
528 * provided with the distribution.
\r
530 * Neither the name of the author nor the names of contributors may be used to endorse
\r
531 * or promote products derived from this software without specific prior written permission.
\r
533 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
\r
534 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
535 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
\r
536 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
\r
537 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
\r
538 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
\r
539 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
540 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
\r
541 * OF THE POSSIBILITY OF SUCH DAMAGE.
\r
545 // t: current time, b: begInnIng value, c: change In value, d: duration
\r
546 $.easing.jswing = $.easing.swing;
\r
550 def: 'easeOutQuad',
\r
551 swing: function (x, t, b, c, d) {
\r
552 //alert($.easing.default);
\r
553 return $.easing[$.easing.def](x, t, b, c, d);
\r
555 easeInQuad: function (x, t, b, c, d) {
\r
556 return c*(t/=d)*t + b;
\r
558 easeOutQuad: function (x, t, b, c, d) {
\r
559 return -c *(t/=d)*(t-2) + b;
\r
561 easeInOutQuad: function (x, t, b, c, d) {
\r
562 if ((t/=d/2) < 1) return c/2*t*t + b;
\r
563 return -c/2 * ((--t)*(t-2) - 1) + b;
\r
565 easeInCubic: function (x, t, b, c, d) {
\r
566 return c*(t/=d)*t*t + b;
\r
568 easeOutCubic: function (x, t, b, c, d) {
\r
569 return c*((t=t/d-1)*t*t + 1) + b;
\r
571 easeInOutCubic: function (x, t, b, c, d) {
\r
572 if ((t/=d/2) < 1) return c/2*t*t*t + b;
\r
573 return c/2*((t-=2)*t*t + 2) + b;
\r
575 easeInQuart: function (x, t, b, c, d) {
\r
576 return c*(t/=d)*t*t*t + b;
\r
578 easeOutQuart: function (x, t, b, c, d) {
\r
579 return -c * ((t=t/d-1)*t*t*t - 1) + b;
\r
581 easeInOutQuart: function (x, t, b, c, d) {
\r
582 if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
\r
583 return -c/2 * ((t-=2)*t*t*t - 2) + b;
\r
585 easeInQuint: function (x, t, b, c, d) {
\r
586 return c*(t/=d)*t*t*t*t + b;
\r
588 easeOutQuint: function (x, t, b, c, d) {
\r
589 return c*((t=t/d-1)*t*t*t*t + 1) + b;
\r
591 easeInOutQuint: function (x, t, b, c, d) {
\r
592 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
\r
593 return c/2*((t-=2)*t*t*t*t + 2) + b;
\r
595 easeInSine: function (x, t, b, c, d) {
\r
596 return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
\r
598 easeOutSine: function (x, t, b, c, d) {
\r
599 return c * Math.sin(t/d * (Math.PI/2)) + b;
\r
601 easeInOutSine: function (x, t, b, c, d) {
\r
602 return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
\r
604 easeInExpo: function (x, t, b, c, d) {
\r
605 return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
\r
607 easeOutExpo: function (x, t, b, c, d) {
\r
608 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
\r
610 easeInOutExpo: function (x, t, b, c, d) {
\r
611 if (t==0) return b;
\r
612 if (t==d) return b+c;
\r
613 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
\r
614 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
\r
616 easeInCirc: function (x, t, b, c, d) {
\r
617 return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
\r
619 easeOutCirc: function (x, t, b, c, d) {
\r
620 return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
\r
622 easeInOutCirc: function (x, t, b, c, d) {
\r
623 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
\r
624 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
\r
626 easeInElastic: function (x, t, b, c, d) {
\r
627 var s=1.70158;var p=0;var a=c;
\r
628 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
\r
629 if (a < Math.abs(c)) { a=c; var s=p/4; }
\r
630 else var s = p/(2*Math.PI) * Math.asin (c/a);
\r
631 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
\r
633 easeOutElastic: function (x, t, b, c, d) {
\r
634 var s=1.70158;var p=0;var a=c;
\r
635 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
\r
636 if (a < Math.abs(c)) { a=c; var s=p/4; }
\r
637 else var s = p/(2*Math.PI) * Math.asin (c/a);
\r
638 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
\r
640 easeInOutElastic: function (x, t, b, c, d) {
\r
641 var s=1.70158;var p=0;var a=c;
\r
642 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
\r
643 if (a < Math.abs(c)) { a=c; var s=p/4; }
\r
644 else var s = p/(2*Math.PI) * Math.asin (c/a);
\r
645 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
\r
646 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
\r
648 easeInBack: function (x, t, b, c, d, s) {
\r
649 if (s == undefined) s = 1.70158;
\r
650 return c*(t/=d)*t*((s+1)*t - s) + b;
\r
652 easeOutBack: function (x, t, b, c, d, s) {
\r
653 if (s == undefined) s = 1.70158;
\r
654 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
\r
656 easeInOutBack: function (x, t, b, c, d, s) {
\r
657 if (s == undefined) s = 1.70158;
\r
658 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
\r
659 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
\r
661 easeInBounce: function (x, t, b, c, d) {
\r
662 return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
\r
664 easeOutBounce: function (x, t, b, c, d) {
\r
665 if ((t/=d) < (1/2.75)) {
\r
666 return c*(7.5625*t*t) + b;
\r
667 } else if (t < (2/2.75)) {
\r
668 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
\r
669 } else if (t < (2.5/2.75)) {
\r
670 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
\r
672 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
\r
675 easeInOutBounce: function (x, t, b, c, d) {
\r
676 if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
\r
677 return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
\r
683 * TERMS OF USE - EASING EQUATIONS
\r
685 * Open source under the BSD License.
\r
687 * Copyright 2001 Robert Penner
\r
688 * All rights reserved.
\r
690 * Redistribution and use in source and binary forms, with or without modification,
\r
691 * are permitted provided that the following conditions are met:
\r
693 * Redistributions of source code must retain the above copyright notice, this list of
\r
694 * conditions and the following disclaimer.
\r
695 * Redistributions in binary form must reproduce the above copyright notice, this list
\r
696 * of conditions and the following disclaimer in the documentation and/or other materials
\r
697 * provided with the distribution.
\r
699 * Neither the name of the author nor the names of contributors may be used to endorse
\r
700 * or promote products derived from this software without specific prior written permission.
\r
702 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
\r
703 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
704 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
\r
705 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
\r
706 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
\r
707 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
\r
708 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
709 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
\r
710 * OF THE POSSIBILITY OF SUCH DAMAGE.
\r