我正在尝试创建一个包含 4 个图像的画廊。当鼠标进入时,图像略有增加。它正在工作,但图像没有按比例放大或缩小。图像不会缩小到其原始大小,即 (h)200px (w)267px。谢谢!
$(document).ready(function(){
$('.image').width(267);
$('.image').mouseenter(function()
{
$(this).css("cursor","pointer");
$(this).animate({width: "60%", height:"60%"}, 'slow');
});
$('.image').mouseleave(function()
{
$(this).animate({width: "267px"}, 'slow');
});
});
</script>
</head>
<body>
<div id="container">
<h2>Gallery Test</h2>
<hr />
<div id="content">
</div>
<div id="gallery">
<img class="image" src="images/one.jpg" height="200px" width="267px">
<img class="image" src="images/two.jpg" height="200px" width="267px">
<img class="image" src="images/three.jpg" height="200px" width="267px">
<img class="image" src="images/four.jpg" height="200px" width="267px">
</div>
</div>