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.
It should be: var old_effect; if (old_effect) old_effect.cancel(); old_effect = new Effect.Fade($(''error_msg'')); Thomas Am 05.11.2005 um 04:30 schrieb David Teare:> 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. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs