I look around to learn how to fade a background color using jquery, but all of the answers lead to the jquery color plugin, which I don’t wanna use. I want a pure jquery code to do it but can’t seem to find it. And my work place are very reluctant on using plugings for their site, so I must use pure jquery.
I’m not an expert in jquery but this is what I came up with, which I think is not the solution:
$('#fade').css('background-color', '#2CAEA8').animate({'opacity': 0});
I just want the background to fade to white from any color. Please can someone show me the way? Thank you.
Why not write the the code yourself?
You know that FFFFFF is white, which can be interpreted as RGB 255 255 255
For example, you have a rgb (converted from hex) value 100 100 100 and then you just run a loop and increment those values till they reach 255, and set the background color to the matching on every iteration.