Please check out my fiddle. Why does the flash effect only happen on the first click. After that it does not flash anymore:
/
$("#button").click(function (e) {
$(this).css('background', '#03182B').delay(500).queue(function(d) {
$(this).css('background', '');
});
});
Please check out my fiddle. Why does the flash effect only happen on the first click. After that it does not flash anymore:
http://jsfiddle/vyAkk/
$("#button").click(function (e) {
$(this).css('background', '#03182B').delay(500).queue(function(d) {
$(this).css('background', '');
});
});
Share
Improve this question
asked Jul 27, 2012 at 17:22
user974896user974896
1,8134 gold badges30 silver badges48 bronze badges
1
- interesting im curious to see the solution myself – Frank Visaggio Commented Jul 27, 2012 at 17:26
2 Answers
Reset to default 5You're not dequeueing.
$("#button").click(function(e) {
$(this).css('background', '#03182B').delay(500).queue(function(d) {
$(this).css('background', '');
$(this).dequeue();
});
});
jsFiddle example
Something's getting mucked up in the event queue. Try stop()
ing the chain of events each time before you run the animation:
$("#button").click(function (e) {
$(this).stop().css('background', '#03182B').delay(500).queue(function(d) {
$(this).css('background', '');
});
});
Fiddle