【问题标题】:css or Jquery image gallery on hover increase image size and decrease size and rearrange other images悬停时的 css 或 Jquery 图像库增加图像大小并减小大小并重新排列其他图像
【发布时间】:2014-01-24 11:21:44
【问题描述】:

我正在制作一个放大悬停图像的图片库。我需要没有悬停的图像来调整大小并重新排列它们,以便它们在图像周围可见。我已经尝试过 jQuery,但我不知道如何移动图像并调整它们的大小。我很高兴尝试 css 或 jquery。

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

here is a link to the full project on my github

【问题讨论】:

    标签: javascript jquery html image css


    【解决方案1】:

    为什么不直接使用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;
    }
    

    【讨论】:

      猜你喜欢
      • 2016-01-27
      • 2012-03-29
      • 2013-07-17
      • 1970-01-01
      • 1970-01-01
      • 2020-01-25
      • 1970-01-01
      • 2017-04-22
      • 1970-01-01
      相关资源
      最近更新 更多