CSS或JQuery图像库悬停会增加图像大小并减小大小并重新排列其他图像



我在放大盘旋图像的图像库上工作。我需要没有悬停的图像来调整大小和重新排列,以便在图像周围看到它们。我尝试了jQuery,但我无法弄清楚如何将图像移动并调整它们的大小。我很高兴尝试CSS或JQuery。

$(".picture").hover(function(){
$(this).animate({height: "500px",width: "500px" });
}, function() {
$(this).animate({ height: "200px", width: "200px" });
});

这是我Github上完整项目的链接

为什么不只是使用CSS,所以在类图片中,

.picture{
     -webkit-transition: all 0.3s;
      moz-transition: all 0.3s;
      transition: all 0.3s;
      //set initial height and width here (this is important)
}
.picture:hover{
    height: 500px;
    width: 500px;
}

最新更新