Hi,
in order to simplify usage of my hoverFlow plugin, I'd like to have
access to the animation properties object used by jQuery's shortcut
animations like slideDown/slideUp.
This can be done with only one additional statement:
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show", 1),
slideUp: genFx("hide", 1),
slideToggle: genFx("toggle", 1),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" }
}, function( name, props ){
jQuery[ name ] = props; // Give access to animation properties
jQuery.fn[ name ] = function( speed, callback ){
return this.animate( props, speed, callback );
};
});
What do you think? Do you see any other use case for this? Do you see
another way of doing this?
Instead of cluttering the jQuery namespace with 5 more properties, we
could also wrap it into a single object. animProps? defaultAnimations?
Anyone?
Ralf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---