我有一个图像覆盖另一个图像,我希望后面的图像在悬停时展开。问题是我无法使背后图像(背景图像)均匀扩展。它向右上方生长。
$(".wooll").hover(function() {
$(this).animate({
'height': $(this).height() * 1.8,
'width' : $(this).width() * 1.8
});
},function() {
$(this).animate({
'height': $(this).height() / 1.8,
'width' : $(this).width() / 1.8
});
});
如何将它定位在父 div 的中心以使其均匀扩展?
<div id="woolley-expand">
<img class="wooll" style="text-align: center; position: absolute; bottom: 0px;" src="/images/component-bottle-big.png" width="60" height="117" />
<img src="/images/free-spray-text.png" style="position: absolute; bottom: 0; left: 0;"/>
</div>
#woolley-expand {
position: relative;
width: 200px;
height: 300px;
}