logo       

How to cancel an effect: msg#00011

lang.ruby.rails.spinoffs

Subject: How to cancel an effect

Hi all,

I have a situation where I want to display an error message, and have it fade away after a 2 second delay. My problem is an impatient user could click buttons so fast that multiple Fade effects will be in play. I believe script.aculo.us can supports canceling existing effects before starting a new one, but couldn't find any examples.

I tried something like this but it doesn't seem to work:

var old_effect;

if (old_effect) old_effect.cancel
old_effect = new Effect.Fade($('error_msg'));

Am I close?

Thanks!
--Dave.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise