Effect.SlideDown: the 'afterFinish' callback fires immediately

129 views
Skip to first unread message

Sander

unread,
Apr 24, 2012, 5:00:30 AM4/24/12
to prototype-s...@googlegroups.com
Hello,

I am using the following code:

Effect.SlideDown($('floating_basket_wrapper'), {
  duration: 5,
  afterFinish: console.log('afterFinish')
});

The effect triggers fine, however I see 'afterFinish' right after starting the movement in the console and not after the effect has finished.

To me, this seems like a bug, or am I doing something wrong here?

Wojtek Zadora

unread,
Apr 24, 2012, 5:23:35 AM4/24/12
to prototype-s...@googlegroups.com
Try this


Effect.SlideDown($('floating_basket_wrapper'), {
  duration: 5,
  afterFinish: function()
  {
      console.log('afterFinish')
;
     }
});

-wz

--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/AEoBwMagov8J.
To post to this group, send email to prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.

Sander Thalen

unread,
Apr 24, 2012, 5:30:02 AM4/24/12
to prototype-s...@googlegroups.com
Thanks Wojtek!

That does indeed work.
I figured out what I did wrong also in the meantime:

afterFinish: callToFunction() does not work, while
afterFinish: callToFunction does.


Sander

Reply all
Reply to author
Forward
0 new messages