Fold: Fixed duration.

This commit is contained in:
Scott González 2009-01-14 02:06:04 +00:00
parent ee28d263b6
commit 4496146898

View File

@ -23,6 +23,7 @@ $.effects.fold = function(o) {
var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
var size = o.options.size || 15; // Default fold size var size = o.options.size || 15; // Default fold size
var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
// Adjust // Adjust
$.effects.save(el, props); el.show(); // Save & Show $.effects.save(el, props); el.show(); // Save & Show
@ -40,8 +41,8 @@ $.effects.fold = function(o) {
animation2[ref[1]] = mode == 'show' ? distance[1] : 0; animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
// Animate // Animate
wrapper.animate(animation1, o.duration / 2, o.options.easing) wrapper.animate(animation1, duration, o.options.easing)
.animate(animation2, o.duration / 2, o.options.easing, function() { .animate(animation2, duration, o.options.easing, function() {
if(mode == 'hide') el.hide(); // Hide if(mode == 'hide') el.hide(); // Hide
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
if(o.callback) o.callback.apply(el[0], arguments); // Callback if(o.callback) o.callback.apply(el[0], arguments); // Callback