r759 - in trunk: demos/real-world/accordion-drawers ui
Author: eduardolundgren
Date: Mon Sep 29 19:50:23 2008
New Revision: 759
Modified:
trunk/demos/real-world/accordion-drawers/index.html
trunk/ui/ui.accordion.js
Log:
Accordion: added support for effects.core ease equations
Modified: trunk/demos/real-world/accordion-drawers/index.html
==============================================================================
--- trunk/demos/real-world/accordion-drawers/index.html (original)
+++ trunk/demos/real-world/accordion-drawers/index.html Mon Sep 29 19:50:23
2008
@@ -162,6 +162,7 @@
<script type="text/javascript" src="../../../ui/ui.core.js"></script>
<script type="text/javascript" src="../../../ui/ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/effects.core.js"></script>
<script type="text/javascript">
@@ -170,6 +171,16 @@
$('ul.drawers').accordion({
header: 'h2.drawer-handle',
selectedClass: 'open',
+ //animated: 'easeOutBounce',
+ //animated: 'bounceslide',
+ //animated: 'easeslide',
+ animated: function(options) {
+ return options.down ? "easeOutBounce" : "easeInOutCubic";
+ },
+ //duration: 500,
+ duration: function(options) {
+ return options.down ? 700 : 400;
+ },
event: 'mouseover'
});
});
Modified: trunk/ui/ui.accordion.js
==============================================================================
--- trunk/ui/ui.accordion.js (original)
+++ trunk/ui/ui.accordion.js Mon Sep 29 19:50:23 2008
@@ -127,23 +127,55 @@
options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
if ( options.animated ) {
+ var animOptions = {};
+
if ( !options.alwaysOpen && clickedActive ) {
- $.ui.accordion.animations[options.animated]({
+ animOptions = {
toShow: jQuery([]),
toHide: toHide,
complete: complete,
down: down,
autoHeight: options.autoHeight
- });
+ };
} else {
- $.ui.accordion.animations[options.animated]({
+ animOptions = {
toShow: toShow,
toHide: toHide,
complete: complete,
down: down,
autoHeight: options.autoHeight
- });
+ };
+ }
+
+ if (!options.proxied) {
+ options.proxied = options.animated;
+ }
+
+ if (!options.proxiedDuration) {
+ options.proxiedDuration = options.duration;
+ }
+
+ options.animated = $.isFunction(options.proxied) ?
+ options.proxied(animOptions) : options.proxied;
+
+ options.duration = $.isFunction(options.proxiedDuration) ?
+ options.proxiedDuration(animOptions) : options.proxiedDuration;
+
+ var animations = $.ui.accordion.animations,
+ duration = options.duration,
+ easing = options.animated;
+
+ if (!animations[easing]) {
+ animations[easing] = function(options) {
+ this.slide(options, {
+ easing: easing,
+ duration: duration || 700
+ });
+ };
}
+
+ animations[easing](animOptions);
+
} else {
if ( !options.alwaysOpen && clickedActive ) {
toShow.toggle();
@@ -279,7 +311,7 @@
},
bounceslide: function(options) {
this.slide(options, {
- easing: options.down ? "bounceout" : "swing",
+ easing: options.down ? "easeOutBounce" : "swing",
duration: options.down ? 1000 : 200
});
},