I have thoroughly tested the remaining sections of my code and they are functioning correctly, however, it is not working within this particular section.
This snippet of code seems to be where the errors or issues lie.
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);
});
}
It's important to note that "$previousAnchor" "$anchor," and "bgc" represent variables. After investigating this issue thoroughly, it appears that there may be a problem with the "backgroundColor" animate function in JQuery, but I am unsure of how to resolve it.
Update:
I made adjustments to the if statement by adding spaces in the RGB code like so:
if(bgc.css("background-color") == "rgb(38, 64, 163)")
Now it enters the correct condition, but the animation still does not seem to be working. It remains inactive and proceeds to the subsequent callback function.
UPDATED RESOLUTION
For anyone encountering difficulties with BACKGROUND-COLOR animations in jQuery, you will need to utilize the following resource: github.com
Make sure to install the jquery.color.js plugin as it is essential for resolving these issues.