Javascript - Scriptaculous - Effect Callback Function

I use scriptaculous to perform a sliding effect using the following code:

Effect.SlideDown('dom_element_id');

Then I will hide a button that initiates this effect using:

$('button_id').hide();

The problem is that the button is hidden until the end of the animation effect, I would like it to hide after the end of the animation effect. I could not find the callback parameter for Effect.SlideDown.

+3
source share
1 answer

You can pass a parameter afterFinishto pass a callback that will be triggered after the effect is complete.

Effect.SlideDown('dom_element_id', { afterFinish: function () {$('button_id').hide(); } } );

EDIT

, beforeFinish, afterFinish, beforeSetup, afterSetup, beforeUpdate afterUpdate, Effect.Base.

. .

+13

Source: https://habr.com/ru/post/1734343/


All Articles