As the name suggests, I expected afterFinish to call my function right after the effect finishes. Simple testing with an alert shows that it instead seems to call the function as the effect is getting started, shortly after the beforeStart callback triggers. Apparently I’m not the only one having this problem.
Further investigation shows this problem only affects a couple of effects:
While these effects handle it just fine:
- Fold (afterFinish triggered just before the element was reduced to nothing/hidden)
Alternately you can call your own existing functions by simply including the function name (without parentheses):
I don’t know if I have the time, but I can be pretty stubborn about these things… I’m tempted to digest Scriptaculous line by line until I understand how it all works so that I can create a fix.
Update (20061122): Try this solution: Scriptaculous Effect.Squish afterFinish callback fix