Fmdpa Posted July 25, 2010 Share Posted July 25, 2010 I am trying to create an animation with jQuery that basically would show to div (#contact) and I would use the animate function to add a CSS3 property... $(#contact).animate({border-radius:7}, 1000); I test it in a CSS3 supporting browser, but to no avail. Any suggestions? Link to comment Share on other sites More sharing options...
Synook Posted July 25, 2010 Share Posted July 25, 2010 "#contact" and "border-radius" probably needs quotation marks around it. They are still strings, remember. Link to comment Share on other sites More sharing options...
Fmdpa Posted July 25, 2010 Author Share Posted July 25, 2010 Sorry, I missed the quotes in the sample code. But my original page did have quotes, and it still didn't work. Link to comment Share on other sites More sharing options...
MrFish Posted July 25, 2010 Share Posted July 25, 2010 Are you sure it's possible to animate a border radius? It's not even supported by all browsers and the ones that do usually have their own version of it. ( -moz- -webkit- -op- ) Link to comment Share on other sites More sharing options...
Synook Posted July 25, 2010 Share Posted July 25, 2010 After a bit of fiddling, I found you have to (a) use lowerCamelCase notation and ( specify each corner individually. var r = 7;$("#contact").animate({ "borderTopLeftRadius" : r, "borderTopRightRadius" : r, "borderBottomLeftRadius" : r, "borderBottomRightRadius" : r,}, 1000); P.S. MrFish, jQuery can animate any numeric CSS property. Link to comment Share on other sites More sharing options...
Fmdpa Posted July 25, 2010 Author Share Posted July 25, 2010 Thanks, Synook! Link to comment Share on other sites More sharing options...
Fmdpa Posted July 25, 2010 Author Share Posted July 25, 2010 It works great with CSS3 browsers, but in semi-CSS3 browsers, it doesn't work. How would I add the browser prefixes to the jQuery animation parameters so it would work in moz and webkit browsers? Link to comment Share on other sites More sharing options...
ApocalypeX Posted July 25, 2010 Share Posted July 25, 2010 Does jQuery allow hyphens? - try borderRadius. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.