Link to home
Start Free TrialLog in
Avatar of Brad Bansner
Brad Bansner

asked on

jQuer: avoid user double-clicking button fast to duplicate animation

Here is my screen:

http://www.genspangroup.com/survey/index.asp?id=HBEYBTW4SS&surveyid=1

When you click the Previous or Next buttons, the attached code does a fadeOut and a fadeIn of the various questions. If you click the Next button twice, very quickly, you get something like the attached screenshot.

I put stop() commands in, thinking it would solve this problem, but apparently it does not. Or maybe I am not using stop() correctly? Thanks!
$('#question'+currentQuestion).stop().fadeOut(200, function(){

//other Javascript

	$('#question'+newQuestion).stop().fadeIn(800);
});

Open in new window

1.jpg
ASKER CERTIFIED SOLUTION
Avatar of StingRaY
StingRaY
Flag of Thailand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brad Bansner
Brad Bansner

ASKER

Ah, of course. Simple and fixes it.