From d9db3c9b997c903a9e977b4fa4928ef2357a111b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 31 Jan 2012 08:55:51 -0500 Subject: [PATCH 1/6] Accordion: Attempt at improving animation. --- ui/jquery.ui.accordion.js | 112 ++++++++++++++------------------------ 1 file changed, 41 insertions(+), 71 deletions(-) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 48d61448d4e..c707d5b2491 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -433,17 +433,11 @@ $.extend( $.ui.accordion, { animations: { slide: function( options, additions ) { if ( options.prevShow || options.prevHide ) { + options.prevShow.stop( true, true ); options.prevHide.stop( true, true ); options.toHide = options.prevShow; } - var showOverflow = options.toShow.css( "overflow" ), - hideOverflow = options.toHide.css( "overflow" ), - percentDone = 0, - showProps = {}, - hideProps = {}, - fxAttrs = [ "height", "paddingTop", "paddingBottom" ], - originalWidth; options = $.extend({ easing: "swing", duration: 300 @@ -452,23 +446,12 @@ $.extend( $.ui.accordion, { options.widget.lastToggle = options; if ( !options.toHide.size() ) { - originalWidth = options.toShow[0].style.width; options.toShow - .show() - .width( options.toShow.width() ) - .hide() .animate({ height: "show", paddingTop: "show", paddingBottom: "show" - }, { - duration: options.duration, - easing: options.easing, - complete: function() { - options.toShow.width( originalWidth ); - options.complete(); - } - }); + }, options ); return; } if ( !options.toShow.size() ) { @@ -479,61 +462,35 @@ $.extend( $.ui.accordion, { }, options ); return; } - // fix width before calculating height of hidden element - var s = options.toShow; - originalWidth = s[0].style.width; - s.width( s.parent().width() - - parseFloat( s.css( "paddingLeft" ) ) - - parseFloat( s.css( "paddingRight" ) ) - - ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 ) - - ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) ); - - $.each( fxAttrs, function( i, prop ) { - hideProps[ prop ] = "hide"; - - var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ ), - // work around bug when a panel has no height - #7335 - propVal = prop === "height" && parts[ 1 ] === "0" ? 1 : parts[ 1 ]; - showProps[ prop ] = { - value: propVal, - unit: parts[ 2 ] || "px" - }; - }); - options.toShow.css({ height: 0, overflow: "hidden" }).show(); - options.toHide - .filter( ":hidden" ) - .each( options.complete ) - .end() - .filter( ":visible" ) - .animate( hideProps, { - step: function( now, settings ) { - if ( settings.prop == "height" || settings.prop == "paddingTop" || settings.prop == "paddingBottom" ) { - percentDone = ( settings.end - settings.start === 0 ) ? 0 : - ( settings.now - settings.start ) / ( settings.end - settings.start ); - } - options.toShow[ 0 ].style[ settings.prop ] = - ( percentDone * showProps[ settings.prop ].value ) - + showProps[ settings.prop ].unit; - }, + var total = options.toShow.show().outerHeight(); + options.toHide.animate( hideProps, { duration: options.duration, - easing: options.easing, - complete: function() { - options.toShow.css({ - width: originalWidth, - overflow: showOverflow - }); - options.toHide.css( "overflow", hideOverflow ); - options.complete(); - } + easing: options.easing }); - }, - bounceslide: function( options ) { - this.slide( options, { - easing: options.down ? "easeOutBounce" : "swing", - duration: options.down ? 1000 : 200 - }); - } + options.toShow + .hide() + .data( "togglePair", { + total: total, + toHide: options.toHide + }) + .animate( showProps, { + duration: options.duration, + easing: options.easing, + complete: function() { + setTimeout(function() { + options.toShow.removeData( "togglePair" ); + options.complete(); + }, 1 ); + } + }); + }, + bounceslide: function( options ) { + this.slide( options, { + easing: options.down ? "easeOutBounce" : "swing", + duration: options.down ? 1000 : 200 + }); + } } }); @@ -681,4 +638,17 @@ if ( $.uiBackCompat !== false ) { }( jQuery, jQuery.ui.accordion.prototype ) ); } +$.fx.step._height = function( fx ) { + var elem = $( fx.elem ), + data = elem.data( "togglePair" ); + elem.height( data.total - elem.outerHeight() - data.toHide.outerHeight() + elem.height() ); +}; +var showProps = {}, + hideProps = {}; +showProps._height = showProps.height = + showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; + })( jQuery ); From fab80dfb83555041b6ddbfaf03702706dd3d3c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 9 Feb 2012 15:37:12 -0500 Subject: [PATCH 2/6] Accordion: Cleaned up animation code. --- ui/jquery.ui.accordion.js | 83 +++++++++++---------------------------- 1 file changed, 24 insertions(+), 59 deletions(-) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 9d7cb7c4ba5..7db57acd3c0 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -36,7 +36,7 @@ $.widget( "ui.accordion", { var self = this, options = self.options; - self.lastToggle = {}; + self.prevShow = self.prevHide = $(); self.element.addClass( "ui-accordion ui-widget ui-helper-reset" ); self.headers = self.element.find( options.header ) @@ -363,36 +363,27 @@ $.widget( "ui.accordion", { _toggle: function( data ) { var self = this, - options = self.options, toShow = data.newContent, - toHide = data.oldContent; + toHide = this.prevShow.length ? this.prevShow : data.oldContent; function complete() { self._completed( data ); } - if ( options.animated ) { - var animations = $.ui.accordion.animations, - animation = options.animated, - additional; - - if ( !animations[ animation ] ) { - additional = { - easing: $.easing[ animation ] ? animation : "slide", - duration: 700 - }; - animation = "slide"; - } + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; - animations[ animation ]({ - widget: self, + if ( this.options.animated ) { + // TODO: support specifying an easing and a duration + // TODO: back compat for speciying just an easing + $.ui.accordion.animations[ this.options.animated ]({ toShow: toShow, toHide: toHide, - prevShow: self.lastToggle.toShow, - prevHide: self.lastToggle.toHide, complete: complete, down: toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) ) - }, additional ); + }); } else { toHide.hide(); toShow.show(); @@ -440,50 +431,23 @@ $.widget( "ui.accordion", { $.extend( $.ui.accordion, { animations: { - slide: function( options, additions ) { - if ( options.prevShow || options.prevHide ) { - options.prevShow.stop( true, true ); - options.prevHide.stop( true, true ); - options.toHide = options.prevShow; - } - - options = $.extend({ - easing: "swing", - duration: 300 - }, options, additions ); - - options.widget.lastToggle = options; - + slide: function( options ) { if ( !options.toHide.size() ) { - options.toShow - .animate({ - height: "show", - paddingTop: "show", - paddingBottom: "show" - }, options ); - return; + return options.toShow.animate( showProps, options ); } if ( !options.toShow.size() ) { - options.toHide.animate({ - height: "hide", - paddingTop: "hide", - paddingBottom: "hide" - }, options ); - return; + return options.toHide.animate( hideProps, options ); } var total = options.toShow.show().outerHeight(); - options.toHide.animate( hideProps, { - duration: options.duration, - easing: options.easing - }); + options.toHide.animate( hideProps, options ); options.toShow .hide() .data( "togglePair", { total: total, toHide: options.toHide }) - .animate( showProps, { + .animate( showPropsAdjust, { duration: options.duration, easing: options.easing, complete: function() { @@ -495,10 +459,10 @@ $.extend( $.ui.accordion, { }); }, bounceslide: function( options ) { - this.slide( options, { + this.slide( $.extend( options, { easing: options.down ? "easeOutBounce" : "swing", duration: options.down ? 1000 : 200 - }); + })); } } }); @@ -652,12 +616,13 @@ $.fx.step._height = function( fx ) { data = elem.data( "togglePair" ); elem.height( data.total - elem.outerHeight() - data.toHide.outerHeight() + elem.height() ); }; -var showProps = {}, - hideProps = {}; -showProps._height = showProps.height = - showProps.paddingTop = showProps.paddingBottom = - showProps.borderTopWidth = showProps.borderBottomWidth = "show"; +var hideProps = {}, + showProps = {}, + showPropsAdjust = {}; hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; +$.extend( showPropsAdjust, showProps, { _height: "show" } ); })( jQuery ); From 779c45bf65918bd1f5f12fe7089eb2308e1b31c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 11 Feb 2012 19:10:39 -0500 Subject: [PATCH 3/6] Accordion: Cleaned up height equalization. --- ui/jquery.ui.accordion.js | 50 ++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 7db57acd3c0..811ec1077bc 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -432,6 +432,8 @@ $.widget( "ui.accordion", { $.extend( $.ui.accordion, { animations: { slide: function( options ) { + var total; + if ( !options.toHide.size() ) { return options.toShow.animate( showProps, options ); } @@ -439,11 +441,11 @@ $.extend( $.ui.accordion, { return options.toHide.animate( hideProps, options ); } - var total = options.toShow.show().outerHeight(); + total = options.toShow.show().outerHeight(); options.toHide.animate( hideProps, options ); options.toShow .hide() - .data( "togglePair", { + .data( "accordionHeight", { total: total, toHide: options.toHide }) @@ -452,21 +454,35 @@ $.extend( $.ui.accordion, { easing: options.easing, complete: function() { setTimeout(function() { - options.toShow.removeData( "togglePair" ); + options.toShow.removeData( "accordionHeight" ); options.complete(); }, 1 ); } }); - }, - bounceslide: function( options ) { - this.slide( $.extend( options, { - easing: options.down ? "easeOutBounce" : "swing", - duration: options.down ? 1000 : 200 - })); - } + }, + bounceslide: function( options ) { + this.slide( $.extend( options, { + easing: options.down ? "easeOutBounce" : "swing", + duration: options.down ? 1000 : 200 + })); + } } }); +$.fx.step.accordionHeight = function( fx ) { + var elem = $( fx.elem ), + data = elem.data( "accordionHeight" ); + elem.height( data.total - elem.outerHeight() - data.toHide.outerHeight() + elem.height() ); +}; +var hideProps = {}, + showProps = {}, + showPropsAdjust = {}; +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; +$.extend( showPropsAdjust, showProps, { accordionHeight: "show" } ); + // DEPRECATED @@ -611,18 +627,4 @@ if ( $.uiBackCompat !== false ) { }( jQuery, jQuery.ui.accordion.prototype ) ); } -$.fx.step._height = function( fx ) { - var elem = $( fx.elem ), - data = elem.data( "togglePair" ); - elem.height( data.total - elem.outerHeight() - data.toHide.outerHeight() + elem.height() ); -}; -var hideProps = {}, - showProps = {}, - showPropsAdjust = {}; -hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = - hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; -showProps.height = showProps.paddingTop = showProps.paddingBottom = - showProps.borderTopWidth = showProps.borderBottomWidth = "show"; -$.extend( showPropsAdjust, showProps, { _height: "show" } ); - })( jQuery ); From 3462ce26150d1b111de1cb350e296c1fa2af7fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 11 Feb 2012 19:47:07 -0500 Subject: [PATCH 4/6] Accordion: New animation API. --- ui/jquery.ui.accordion.js | 101 +++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 55 deletions(-) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 811ec1077bc..8c04fe4745f 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -17,6 +17,7 @@ $.widget( "ui.accordion", { version: "@VERSION", options: { active: 0, + // TODO: animation option animated: "slide", collapsible: false, event: "click", @@ -362,32 +363,22 @@ $.widget( "ui.accordion", { }, _toggle: function( data ) { - var self = this, - toShow = data.newContent, + var toShow = data.newContent, toHide = this.prevShow.length ? this.prevShow : data.oldContent; - function complete() { - self._completed( data ); - } - // handle activating a panel during the animation for another activation this.prevShow.add( this.prevHide ).stop( true, true ); this.prevShow = toShow; this.prevHide = toHide; if ( this.options.animated ) { - // TODO: support specifying an easing and a duration - // TODO: back compat for speciying just an easing - $.ui.accordion.animations[ this.options.animated ]({ - toShow: toShow, - toHide: toHide, - complete: complete, - down: toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) ) - }); + // TODO: back compat for animated option + // TODO: back compat for bounceslide + this._animate( toShow, toHide, data ); } else { toHide.hide(); toShow.show(); - complete(); + this._completed( data ); } // TODO assert that the blur and focus triggers are really necessary, remove otherwise @@ -407,6 +398,46 @@ $.widget( "ui.accordion", { .focus(); }, + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animation = this.options.animation || {}, + options = down && animation.down || animation, + complete = function() { + toShow.removeData( "accordionHeight" ); + that._completed( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animation.easing; + duration = duration || options.duration || animation.duration; + + if ( !toHide.size() ) { + return toShow.animate( showProps, duration, easing, complete ); + } + if ( !toShow.size() ) { + return toHide.animate( hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( hideProps, duration, easing ); + toShow + .hide() + .data( "accordionHeight", { + total: total, + toHide: toHide + }) + .animate( showPropsAdjust, duration, easing, complete ); + }, + _completed: function( data ) { var toShow = data.newContent, toHide = data.oldContent; @@ -429,46 +460,6 @@ $.widget( "ui.accordion", { } }); -$.extend( $.ui.accordion, { - animations: { - slide: function( options ) { - var total; - - if ( !options.toHide.size() ) { - return options.toShow.animate( showProps, options ); - } - if ( !options.toShow.size() ) { - return options.toHide.animate( hideProps, options ); - } - - total = options.toShow.show().outerHeight(); - options.toHide.animate( hideProps, options ); - options.toShow - .hide() - .data( "accordionHeight", { - total: total, - toHide: options.toHide - }) - .animate( showPropsAdjust, { - duration: options.duration, - easing: options.easing, - complete: function() { - setTimeout(function() { - options.toShow.removeData( "accordionHeight" ); - options.complete(); - }, 1 ); - } - }); - }, - bounceslide: function( options ) { - this.slide( $.extend( options, { - easing: options.down ? "easeOutBounce" : "swing", - duration: options.down ? 1000 : 200 - })); - } - } -}); - $.fx.step.accordionHeight = function( fx ) { var elem = $( fx.elem ), data = elem.data( "accordionHeight" ); From 0f43dc43177bb5065cf6ef077fa88fc6a65fa1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sun, 12 Feb 2012 13:01:01 -0500 Subject: [PATCH 5/6] Accordion: Fixed animation for heightStyle: content; Force height of accordion for non-content heightStyle to improve animation in Firefox. --- ui/jquery.ui.accordion.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 3185d0d6add..12b3363dd63 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -63,6 +63,7 @@ $.widget( "ui.accordion", { this.active.next().addClass( "ui-accordion-content-active" ); this._createIcons(); + this.originalHeight = this.element[0].style.height; this.refresh(); // ARIA @@ -157,6 +158,7 @@ $.widget( "ui.accordion", { .removeAttr( "role" ) .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" ); if ( this.options.heightStyle !== "content" ) { + this.element.css( "height", this.originalHeight ); contents.css( "height", "" ); } }, @@ -230,12 +232,12 @@ $.widget( "ui.accordion", { }, refresh: function() { - var options = this.options, + var heightStyle = this.options.heightStyle, parent = this.element.parent(), maxHeight, overflow; - if ( options.heightStyle === "fill" ) { + if ( heightStyle === "fill" ) { // IE 6 treats height like minHeight, so we need to turn off overflow // in order to get a reliable height // we use the minHeight support test because we assume that only @@ -268,7 +270,7 @@ $.widget( "ui.accordion", { $( this ).innerHeight() + $( this ).height() ) ); }) .css( "overflow", "auto" ); - } else if ( options.heightStyle === "auto" ) { + } else if ( heightStyle === "auto" ) { maxHeight = 0; this.headers.next() .each(function() { @@ -277,7 +279,9 @@ $.widget( "ui.accordion", { .height( maxHeight ); } - return this; + if ( heightStyle !== "content" ) { + this.element.height( this.element.height() ); + } }, _activate: function( index ) { @@ -434,20 +438,14 @@ $.widget( "ui.accordion", { total: total, toHide: toHide }) - .animate( showPropsAdjust, duration, easing, complete ); + .animate( this.options.heightStyle === "content" ? showProps : showPropsAdjust, + duration, easing, complete ); }, _completed: function( data ) { var toShow = data.newContent, toHide = data.oldContent; - if ( this.options.heightStyle === "content" ) { - toShow.add( toHide ).css({ - height: "", - overflow: "" - }); - } - // other classes are removed before the animation; this one needs to stay until completed toHide.removeClass( "ui-accordion-content-active" ); // Work around for rendering bug in IE (#5421) From af94c375085b0c800fbdfb4e7c945eb7b542ad08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 16 Feb 2012 16:44:31 -0500 Subject: [PATCH 6/6] Accordion: Changed option name to animate and added back-compat for animated option. --- tests/unit/accordion/accordion_defaults.js | 2 +- .../accordion_defaults_deprecated.js | 1 + .../unit/accordion/accordion_test_helpers.js | 6 +-- ui/jquery.ui.accordion.js | 49 +++++++++++++++---- 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/tests/unit/accordion/accordion_defaults.js b/tests/unit/accordion/accordion_defaults.js index 9aa58e650e3..9ad85bbce51 100644 --- a/tests/unit/accordion/accordion_defaults.js +++ b/tests/unit/accordion/accordion_defaults.js @@ -1,7 +1,7 @@ commonWidgetTests( "accordion", { defaults: { active: 0, - animated: "slide", + animate: {}, collapsible: false, disabled: false, event: "click", diff --git a/tests/unit/accordion/accordion_defaults_deprecated.js b/tests/unit/accordion/accordion_defaults_deprecated.js index 3f45a1f10b9..99f5ac8273c 100644 --- a/tests/unit/accordion/accordion_defaults_deprecated.js +++ b/tests/unit/accordion/accordion_defaults_deprecated.js @@ -1,6 +1,7 @@ commonWidgetTests( "accordion", { defaults: { active: 0, + animate: null, animated: "slide", autoHeight: true, clearStyle: false, diff --git a/tests/unit/accordion/accordion_test_helpers.js b/tests/unit/accordion/accordion_test_helpers.js index 66d60a46981..7b316e9837c 100644 --- a/tests/unit/accordion/accordion_test_helpers.js +++ b/tests/unit/accordion/accordion_test_helpers.js @@ -18,13 +18,13 @@ function accordion_equalHeights( accordion, min, max ) { } function accordion_setupTeardown() { - var animated = $.ui.accordion.prototype.options.animated; + var animate = $.ui.accordion.prototype.options.animate; return { setup: function() { - $.ui.accordion.prototype.options.animated = false; + $.ui.accordion.prototype.options.animate = false; }, teardown: function() { - $.ui.accordion.prototype.options.animated = animated; + $.ui.accordion.prototype.options.animate = animate; } }; } diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 12b3363dd63..8731c17cac1 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -17,8 +17,7 @@ $.widget( "ui.accordion", { version: "@VERSION", options: { active: 0, - // TODO: animation option - animated: "slide", + animate: {}, collapsible: false, event: "click", header: "> li > :first-child,> :not(li):even", @@ -374,9 +373,7 @@ $.widget( "ui.accordion", { this.prevShow = toShow; this.prevHide = toHide; - if ( this.options.animated ) { - // TODO: back compat for animated option - // TODO: back compat for bounceslide + if ( this.options.animate ) { this._animate( toShow, toHide, data ); } else { toHide.hide(); @@ -406,8 +403,8 @@ $.widget( "ui.accordion", { that = this, down = toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) ), - animation = this.options.animation || {}, - options = down && animation.down || animation, + animate = this.options.animate || {}, + options = down && animate.down || animate, complete = function() { toShow.removeData( "accordionHeight" ); that._completed( data ); @@ -420,8 +417,8 @@ $.widget( "ui.accordion", { easing = options; } // fall back from options to animation in case of partial down settings - easing = easing || options.easing || animation.easing; - duration = duration || options.duration || animation.duration; + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; if ( !toHide.size() ) { return toShow.animate( showProps, duration, easing, complete ); @@ -613,6 +610,40 @@ if ( $.uiBackCompat !== false ) { return ret; }; }( jQuery, jQuery.ui.accordion.prototype ) ); + + // animated option + // NOTE: this only provides support for "slide", "bounceslide", and easings + // not the full $.ui.accordion.animations API + (function( $, prototype ) { + $.extend( prototype.options, { + animate: null, + animated: "slide" + }); + + var _create = prototype._create; + prototype._create = function() { + var options = this.options; + if ( options.animate === null ) { + if ( !options.animated ) { + options.animate = false; + } else if ( options.animated === "slide" ) { + options.animate = 300; + } else if ( options.animated === "bounceslide" ) { + options.animate = { + duration: 200, + down: { + easing: "easeOutBounce", + duration: 1000 + } + } + } else { + options.animate = options.animated; + } + } + + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); } })( jQuery );