I was reading this question about how to make an element “flash” in jQuery, however, the most popular answers relied on jQueryUI which is pretty large to include in a project if all I need is the backgroundColor to animate. Is there a way to flash an element’s background color in a similar manner without using jQueryUI?
Share
you can write a function that contains a for loop with some delay in each cycle. In each cycle of the loop, you can decrease/increase the color value and set it as the background. This gives the same effect as that of animate.