I’ve found a great example right here discussing how to animate specific corners of a border. However, it seems i get no change what so ever. After inserting an alert into the in and out functions i confirmed that they are fired. However, any change to the cornerization are just not there.
Has it to do with how i styled the divs?
div.menuItem {
border-width: 5px 3px;
border-style: solid;
border-radius: 25px 45px 25px 45px;
font: 30px Arial;
font-weight: bold;
padding: 15px;
display: block;
width: 200px;
border-color: #00bb00;
color: #fff;
background-color:#8822cc;
-webkit-text-stroke: 1px #000;
}
And here’s the script.
$('div.menuItem').hover(function () {
alert("in");
$(this).animate({
"MozBorderRadiusTopleft": '50px',
"MozBorderRadiusTopright": '50px'
}, 900);
}, function () {
alert("out");
$(this).animate({
"MozBorderRadiusTopleft": '25px',
"MozBorderRadiusTopright": '25px'
}, 900);
});
You could simply use a CSS transition:
Here’s the fiddle: http://jsfiddle.net/ucVPg/
P.S. Don’t forget the vendor prefixes.