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!
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);
});
1.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER