I have a switch fade effect, but when you press the button several times, it disappears and exits more than once. (So if I press the fade id button 20 times quickly, it will disappear and exit several times). How can I stop this and make it so that you can only switch the attenuation when the animation is done? I tried to get the current value and make an if statement, but that didn't work: * (
thanks
jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);
};
$(document).ready(function() {
$('.open').click(function() {
$('#fadeMe').next().fadeToggle('slow');
});
});
source
share