Timeline for How do you make an element "flash" in jQuery
Current License: CC BY-SA 3.0
28 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 23, 2018 at 14:52 | comment | added | Guido Visser | The code above does work, you just need to include jQuery Color plugin as the post says. | |
Aug 9, 2016 at 11:17 | history | edited | Cheekysoft | CC BY-SA 3.0 |
correct use of "need"
|
May 12, 2014 at 4:16 | comment | added | Chloe | Eeck! This worked in StackOverflow.com console, but not my site, nor JSFiddle! Now my vote is locked in and I can't downvote! jsfiddle.net/Xp4k2 | |
May 12, 2014 at 4:03 | history | edited | Chloe | CC BY-SA 3.0 |
indent last brace as it is part of code. ok just format all the code.
|
S Apr 2, 2014 at 16:26 | history | suggested | Fuzz | CC BY-SA 3.0 |
I added a timeout to the animateHighlight function because if you call the function twice in a row it puts the wrong background color as the original. (very cool function by the way thanks)
|
Apr 2, 2014 at 16:23 | review | Suggested edits | |||
S Apr 2, 2014 at 16:26 | |||||
Aug 5, 2013 at 2:10 | comment | added | Ascherer | If anyone is having issues with this, please comment on what your issue is. We cannot help you if you don't give us something to work with! | |
Jun 30, 2013 at 5:53 | comment | added | Simon_Weaver | urm... hows about somebody that can get this working makes a jsfiddle for it? | |
Jun 27, 2013 at 7:32 | comment | added | Menelaos | I tried this with a <select> element... changed color but did not change it back. | |
May 16, 2013 at 7:52 | history | edited | MarioDS | CC BY-SA 3.0 |
Corrected information.
|
May 16, 2013 at 7:48 | comment | added | MarioDS | What the hell, wrong information on SO with +77/-15 ? What is this? Nobody cared to edit this answer? I'm doing that right now... | |
Apr 9, 2013 at 7:53 | comment | added | Adam Tomat |
From the jquery .animate docs: Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. - If you want to animate colour, you NEED jQuery UI or some other plugin.
|
|
Dec 12, 2012 at 4:58 | comment | added | jchook | Official jQuery Docs say you must use the jQuery.Color() plugin for this to work: github.com/jquery/jquery-color | |
Aug 7, 2012 at 20:14 | comment | added | codes_occasionally | You're all a bunch of haters. This works fine, make sure you don't put your function declaration inside your document.ready function. This does NOT have a dependency on jquery-ui: both the .animate() and the .stop() methods are native to jquery. | |
Aug 2, 2012 at 21:22 | comment | added | anon | Worked for me with jquery-1.7.2 and jquery-ui-1.8.22. | |
Aug 2, 2012 at 12:21 | comment | added | Stephan K. | Rubbish. Does not Work with latest jQuery UI. | |
Jul 6, 2012 at 2:29 | comment | added | Nick Caballero |
It does work. Requires jQuery UI. Also note that on browsers that support semi-transparent background colors (rgba), jQuery UI stable release does not support and will not animate correctly. Also, using addClass('class', 1000) will animate the element to that class.
|
|
Sep 14, 2011 at 9:22 | comment | added | willdanceforfun | I learned a lot about creating jquery functions thanks to your post. Thanks! | |
May 14, 2011 at 12:13 | comment | added | Sage | I noticed it didnt return an object. I tried stacking this little effect (EG: $("#qtyonhand").animateHighlight("#c3d69b", 1500).delay(1500).animateHighlight("#76923C", 5000); ) and got an error. I needed to add "return this;" to the end of the method. | |
Dec 22, 2010 at 13:18 | comment | added | UpTheCreek | @colbeerhey: Unfortunately that highlight effect is part of JQueryUI (core effects), you can't use it with just jquery. | |
Dec 21, 2010 at 22:22 | comment | added | curthipster | @UpTheCreek good catch. My project also depends on jQuery UI, which adds the ability to animate color (jqueryui.com/docs/Effects/Methods#Color_Transitions). However, as another user points out below, jQuery provides an effect called 'highlight' now, which provides the same functionality | |
Dec 18, 2010 at 15:17 | comment | added | UpTheCreek | From jquery docs on .animate() : All animated properties should be a single numeric value (except as noted below); properties that are non-numeric cannot be animated using basic jQuery functionality. (For example, width, height, or left can be animated but background-color cannot be.) So I guess you are utilising a plugin without realising it. | |
Dec 18, 2010 at 14:58 | comment | added | UpTheCreek | Doesn't work for me either - are you sure this isn't relying on the color animations plugin? plugins.jquery.com/project/color | |
Oct 19, 2010 at 4:40 | history | edited | curthipster | CC BY-SA 2.5 |
added 750 characters in body
|
Oct 18, 2010 at 21:01 | comment | added | Ryan Ferretti | If anyone is wondering... this was does work now! (tested in FF, Safari, Chrome) | |
Oct 14, 2009 at 7:14 | comment | added | Palantir | this is quite versatile (you can animate any property, like color, instead of backgroundColor). In fact there is a bug, but if this effect is for eye-candy only, it is sufficient to wrap the call with a try-catch block: if it fails, it won't show, but it won't produce errors either. | |
Jul 17, 2009 at 21:37 | comment | added | curthipster | Unfortunately, there is a bug in jQuery that intermittently prevents the color from changing -> dev.jqueryui.com/ticket/4251 | |
Jul 17, 2009 at 21:13 | history | answered | curthipster | CC BY-SA 2.5 |