Phillippe - that works a treat - thank you!

FYI you can also write :

$(el).animate(css,  speed, (function(a,b..){ /* do stuff with a,b
*/}).partial(arg1,arg2...))

Which is the neatest I've seen so far.:D:D

It would be quite neat if jQuery automatically did this if there were
arguments defined after the function?
Is this plausible?

weepy





On 16 Oct, 15:40, "Philippe Rathé" <[EMAIL PROTECTED]> wrote:
> myFunc(arg1, arg2, ..) {
>     //...
>
> }
>
> $(el).animate(css,  speed, myFunc.partial(arg1, arg2, ..)); // use currying
>
> Just now need to extend the function prototype. See John Resig 
> article:http://ejohn.org/blog/partial-functions-in-javascript/
> Use the Function.prototype.partial function.
>
> Philippe Rathé
>
> On Wed, Oct 15, 2008 at 11:46 AM, weepy <[EMAIL PROTECTED]> wrote:
>
> > Hi
>
> > I want to run a function on completion of an animation
> > I want to pass in arguments to this function. Is this possible ?
>
> > e.g.
>
> > $(el).animate(css,  speed, function callback(args to pass in) { /* do
> > stuff */) )
>
> > Any one know how to do this ?
>
> > cheers
>
> > weepy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to