I have tested the rest of my code and is ok, but does not work inside here.
this is the part of the code that has mistakes or something.
if(bgc.css("background-color") == "rgb(38,64,163)") {
bgc.animate({backgroundColor:"rgb(134,210,239)"},800, function() {
$previousAnchor = $anchor,
$anchor.fadeIn(fadetime);
});
} else if(bgc.css("background-color") == "rgb(134,210,239)") {
bgc.animate({backgroundColor:"rgb(38,64,163)"},800, function() {
$previousAnchor = $anchor,
$anchor.fadeIn(fadetime);
});
}
Note that “$previousAnchor” “$anchor” and “bgc” are variables.
I had investigated all of this code, and there has to be a problem in “backgroundColor” animate of Jquery, but i dont know how to fix it.
Edited:
I fixed the if statment, putting Spaces in the RGB code like this
if(bgc.css("background-color") == "rgb(38, 64, 163)")
now it goes inside, but animate does not work yet. It does nothing and continue to the rest of the callback function.
EDITED SOLVED
For all the people that have problems with BACKGROUND-COLOR animate jquery, you need this:
github.com
You need a pluging called jquery.color.js
Add the following JS (jQuery color plugin), (minified version from here)
Test Example :
Here is a fiddle : http://jsfiddle.net/GMNV9/1/