Is there a way in jQuery to animate the css3 border-radius property available in Webkit and Mozilla browsers?
I haven’t found a plugin that will do it.
-webkit-border-radius
-moz-border-radius
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.
I originally expected that something like…
…would work. But, I was wrong: Webkit allows you to set the value for all four corners via
borderRadius, but won’t let you read it back – so with the code above, the animation will always start at 0 instead of 10. IE has the same problem. Firefox will let you read it back, so everything works as expected there.Well… border-radius has sort of a history of implementation differences.
Fortunately, there’s a work-around: just specify each corner radius individually:
Note that if you wish to maintain compatibility with older browsers, you can go all-out and use the old browser-prefixed names:
This starts to get pretty crazy though; I would avoid it if possible.