Image shifting/jumping after CSS transition effect with scale transform in Firefox

后端 未结 4 1972
清歌不尽
清歌不尽 2021-02-20 04:37

I have a problem in latest Firefox browser version 34 (system: Windows 7, screen width: 1600px). I made effect with zooming images (in some container) after hov

4条回答
  •  Happy的楠姐
    2021-02-20 05:20

    I had a similar problem on my project. All images were position: absolute; and the transform look like that:

    figure img{
       transform: translate( -50%, 50%) scale(1);
       position: absolute;
       top: 50%;
       left: 50%;
    }
    
    figure img:hover{
       transform: translate( -50%, 50%) scale(1.1);
    }
    

    I replace every scale with scale3d and that solved my problem. The final styles look like that:

    figure img{
       transform: translate( -50%, 50%) scale3d(1, 1, 1);
       position: absolute;
       top: 50%;
       left: 50%;
    }
    
    figure img:hover{
       transform: translate( -50%, 50%) scale3d(1.1, 1.1, 1);
    }
    

    Hope that's will fix your problem

提交回复
热议问题