Image moves on hover when changing filter in chrome

前端 未结 5 1614
有刺的猬
有刺的猬 2020-12-05 14:43

I have an image, when i blur it on hover, it slightly moves, it\'s like the image shakes in its position, problem only occurs in chrome ( tested with: chromium 63 linux-x86_

5条回答
  •  天涯浪人
    2020-12-05 15:26

    The only way i found to make this work properly is using a svg filter and animate the filter blur with GSAP.

    https://jsfiddle.net/eg5yhu26/4/

    var timeline = TweenMax.to("#hue1feGaussianBlur", 5, {
      paused: true,
      attr: {
        "stdDeviation": 5
      },
      onUpdateParams: ["{self}"]
    });
    
    $(document).on("mouseenter", ".c-grid__item a", function() {
      timeline.play();
    });
    $(document).on("mouseleave", ".c-grid__item a", function() {
      timeline.reverse();
    });
    
    
    

提交回复
热议问题