Is it possible to animate the transition to a CSS :hover rule? I don’t mean to animate into something that I specify in a script, but to something that is specified in CSS.
Share
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.
CSS transitions are widely supported in modern browsers.
If you want wider support than CSS transitions, use jQuery
.animate.However, it’s impossible to get jQuery to recognize the styles you’ve put in a
:hoverpseudo-class. You’ll just have to code the changing styles separately in your JavaScript. (You could use some jQuery/JS trickery to extract the styles if they were added to a proper class, but not a pseudo-class.)