i’m trying to make smooth animation during change class with Jquery.
But it works only with text-color, not background.
You can check this for detail 🙁 :
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is simply a matter of version of the libraries.
Your jsbin shows jQuery 1.3.2 and jQuery UI 1.7.2.
In this jsfiddle (with jq 1.3.2 and jqui 1.7.2), it does not work.
In this other one, latest versions of both libraries, it works.
jQuery 1.3.2 is more thand legacy, you should not use it anymore, except if you don’t have the choice, but then you should expect some (over-the-top) things not to work I’m afraid.
Animating gradients
Looking at the documentation from jQuery UI, they seem not to support gradient on the overloaded .animate() to animate colors (doc). I guess it just works with solid colors.
CSS transitions on the other hand does not handle gradients neither in any browser. There any several workarounds though:
A word on YouTube’s buttons you mention.
For me, the gradients are not animated as they use CSS transitions. Here is how I tested that:
<button>element.[-*-]transition: all 0.218s;to “1s”My opinion is that the animation of the border (etc) gives the impression the gradient is animated but it’s not.