mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: added support for effects.core ease equations
This commit is contained in:
parent
0f58c499be
commit
5b6323d0a3
@ -162,6 +162,7 @@ blockquote, q {
|
|||||||
|
|
||||||
<script type="text/javascript" src="../../../ui/ui.core.js"></script>
|
<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/ui.accordion.js"></script>
|
||||||
|
<script type="text/javascript" src="../../../ui/effects.core.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -170,6 +171,16 @@ blockquote, q {
|
|||||||
$('ul.drawers').accordion({
|
$('ul.drawers').accordion({
|
||||||
header: 'h2.drawer-handle',
|
header: 'h2.drawer-handle',
|
||||||
selectedClass: 'open',
|
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'
|
event: 'mouseover'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -127,23 +127,55 @@ function toggle(toShow, toHide, data, clickedActive, down) {
|
|||||||
options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
|
options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
|
||||||
|
|
||||||
if ( options.animated ) {
|
if ( options.animated ) {
|
||||||
|
var animOptions = {};
|
||||||
|
|
||||||
if ( !options.alwaysOpen && clickedActive ) {
|
if ( !options.alwaysOpen && clickedActive ) {
|
||||||
$.ui.accordion.animations[options.animated]({
|
animOptions = {
|
||||||
toShow: jQuery([]),
|
toShow: jQuery([]),
|
||||||
toHide: toHide,
|
toHide: toHide,
|
||||||
complete: complete,
|
complete: complete,
|
||||||
down: down,
|
down: down,
|
||||||
autoHeight: options.autoHeight
|
autoHeight: options.autoHeight
|
||||||
});
|
};
|
||||||
} else {
|
} else {
|
||||||
$.ui.accordion.animations[options.animated]({
|
animOptions = {
|
||||||
toShow: toShow,
|
toShow: toShow,
|
||||||
toHide: toHide,
|
toHide: toHide,
|
||||||
complete: complete,
|
complete: complete,
|
||||||
down: down,
|
down: down,
|
||||||
autoHeight: options.autoHeight
|
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 {
|
} else {
|
||||||
if ( !options.alwaysOpen && clickedActive ) {
|
if ( !options.alwaysOpen && clickedActive ) {
|
||||||
toShow.toggle();
|
toShow.toggle();
|
||||||
@ -279,7 +311,7 @@ $.extend($.ui.accordion, {
|
|||||||
},
|
},
|
||||||
bounceslide: function(options) {
|
bounceslide: function(options) {
|
||||||
this.slide(options, {
|
this.slide(options, {
|
||||||
easing: options.down ? "bounceout" : "swing",
|
easing: options.down ? "easeOutBounce" : "swing",
|
||||||
duration: options.down ? 1000 : 200
|
duration: options.down ? 1000 : 200
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user