Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery background color animate not working

I want to change the background color of 'exampleDiv' from the original white background to when I call the code below to immediate change the background yellow and then fade back to the original white background.

$("#exampleDiv").animate({ backgroundColor: "yellow" }, "fast");

However, this code does not work.

I have only the JQuery core and JQuery UI linked to my web page.

Why doesn't the code above work?

like image 542
AndyT Avatar asked Nov 07 '09 20:11

AndyT


2 Answers

Just added this snippet below jquery script and it immediately started working:

<script src="https://cdn.jsdelivr.net/jquery.color-animation/1/mainfile"></script>

Source

like image 52
Darush Avatar answered Oct 06 '22 00:10

Darush


I believe you also need JQuery Color Animations.

like image 26
recursive Avatar answered Oct 06 '22 01:10

recursive