框的大小是宽度:200px,高度:140px。 使用动画改变框大小时,它将从左上方变换。 如何更改它从中心中心转换。jQuery〜如何从中心中心动画框宽度和高度
的Html
<div class="box"></div>
CSS
width:200px;
height:140px;
background-color:#0066CC;
jQuery的
$('.box').mouseover(function() {
$(this).animate({
width: "210px",
height: "150px"
}, 200);
});
$('.box').mouseout(function() {
$(this).animate({
width: "200px",
height: "140px"
}, 200);
});