filte transition过渡出现抖动

这是代码:
hover的时候会抖动,不知道为什么,浏览器 chrome比较新的某一版本,请赐教。

<!DOCTYPE html>
<html>
<head>
    <title></title>


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>

*{
    margin:0;
    padding:0;
}




.back{
    height: 100vh;
    width:    100%;
    background:url("http://static.simpledesktops.com/uploads/desktops/2017/03/21/showgaze_pb_02.png") 0 0/100% auto fixed;
    
}

.content{
    z-index:0;
    color:#FFEFA7;
    border-radius: 10px;
    padding: 20px;
    font-family:Lobster;
    letter-spacing: 1px;
    font-size: 35px;

    position: relative;
    height: 300px;
    width:570px;
    margin:10% auto;
    overflow: hidden;
    transition: all  0.3s linear;
    filter: grayscale(1);

    border:2px solid rgba(255,245,244,.3);
    box-shadow:0 0 0 4px rgba(255,245,244,.1); 

}

.content::before{
    margin:-30px;
    z-index:-1;
    content: '';
    display: block;
    position: absolute;
    background:url("http://static.simpledesktops.com/uploads/desktops/2017/03/21/showgaze_pb_02.png") 0 0/100% auto fixed;
    filter:blur(5px);
    left:0;top:0;right:0;bottom:0;
}


.content:hover{
    filter:grayscale(0);

}




</style>
</head>
<body>

<div class='back'>&nbsp;
    <div class='content'>
        there must be some kind of way get out of here,say the joker to the thief.
    </div>
</div>
</body>
</html>
阅读 8k
4 个回答

附chrome版本:
clipboard.png
最简单的方式其实就是将transition的过渡属性变为color,保证不会进行位移上的过渡。
不过这个为何会抖动还在研究中。【其实觉得这抖动蜜汁带感】

transition: color 0.3s linear;

好吧,之前忘了,还有背景的过渡,但是
如果

transition: color,filter 0.3s linear;

这样写,那么也会出现抖动效果。看来是filter的一个问题。
但是用一个img元素进行filter和transition关于grayscale的过渡测试不会导致这个问题发生。
先把原有的:before变为一个正常的div元素,但是仍然有问题。
现在将问题锁定到,存在滚动条时,会出现抖动问题。

什么版本的 我的没有抖动

chrome 60.0.3112.101(正式版本) (32 位)

.back{

height: 100vh;
width:    100vw;
background:url("http://static.simpledesktops.com/uploads/desktops/2017/03/21/showgaze_pb_02.png") 0 0/100% auto fixed;
border:1px solid transparent;
box-sizing: border-box;

}

为什么不是很明白,但是这样是可以达到效果的。

添加transform: translate3d(0,0,0); 动画开始启动cup加速

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题