0
我有这个脚本可以放大悬停时的图像缩略图。如何在使用jQuery保持尺寸的同时调整图像大小?
问题是,一些图像是不同的高度,所以脚本有时会伸展它们不成比例。大部分图像是100×100,但有时他们是100x140,等
有没有办法保存在调整图像的尺寸?
$("ul.gallery-large li").hover(function() {
$(this).find('img').addClass("hover").stop()
.animate({
width: '200px',
height: '200px',
}, 200);
}, function() {
$(this).find('img').removeClass("hover").stop()
.animate({
width: '100px',
height: '100px'
}, 400);
});
感谢。周末愉快 :) – Gaillimh