Timeline for How do you make an element "flash" in jQuery
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 12, 2022 at 10:14 | comment | added | NetVicious |
Modify your answer adding a delay to remove the class to allow more calls jQuery(selector).addClass("flash").delay(1000).queue(function(){ $(this).removeClass("flash").dequeue() });
|
|
Oct 26, 2020 at 18:41 | comment | added | mavrosxristoforos | Obvious note, but useful to mention: This will appear as if it's not working if children elements already have a background! | |
Sep 3, 2018 at 14:44 | comment | added | mmarlow | I love CSS solutions, but it's a lot of code to flash something, compared to javascript. Especially since you're using jQuery anyway. | |
Oct 16, 2017 at 23:14 | comment | added | coredumperror |
Note that all modern browsers now support the regular @keyframes and animation rules, so there's no need to use any prefixed versions besides maybe -webkit- (for the Blackberry browser).
|
|
Oct 16, 2017 at 23:12 | history | edited | coredumperror | CC BY-SA 3.0 |
Fixed incorrect background-color of "none" and added a regular `@keyframes` rule.
|
Dec 1, 2015 at 6:51 | comment | added | kmurph79 |
Chrome seemingly doesn't respond to the -webkit prefix anymore so a @keyframes at-rule is needed.
|
|
Oct 26, 2015 at 6:55 | history | edited | Csaba Toth | CC BY-SA 3.0 |
cleanup CSS formatting 2
|
Dec 16, 2014 at 10:28 | comment | added | Jan M | Great, that works, but note that the correct property for the background-color is 'transparent' instead of 'none' if you want to pass a style sheet validator. | |
Apr 11, 2014 at 1:05 | comment | added | DACrosby | Here's an example of removing the class after the animation's done so you can keep flashing it. jsfiddle.net/daCrosby/eTcXX/1 | |
Aug 24, 2013 at 17:44 | comment | added | insign | The best idea ever. I used a settimeout to remove the class 2 seconds after the effect | |
Mar 8, 2013 at 7:54 | comment | added | simon | Nice solution, if it needs to work only once. After the class has been added, subsequently adding the class does (logically) not result in flashing the element. | |
Oct 18, 2012 at 21:28 | review | Suggested edits | |||
Oct 18, 2012 at 21:32 | |||||
Aug 11, 2012 at 14:56 | history | edited | vinay | CC BY-SA 3.0 |
deleted 24 characters in body
|
Aug 11, 2012 at 14:19 | history | answered | vinay | CC BY-SA 3.0 |