You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加feColorMatrix滤镜后滚动圆形短暂消失问题求助

问题:添加SVG滤镜后滚动的圆形出现短暂消失现象

我编写了一段代码,实现模糊圆形从容器中滚出的效果:

index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div class="container">
        <div class="circle"></div>
    </div>
    <svg>
        <filter id="flt">
            <feGaussianBlur in="SourceGraphic" stdDeviation="8"></feGaussianBlur>
            <feColorMatrix type="matrix" values="
            1 0 0 0 0
            0 1 0 0 0
            0 0 1 0 0
            0 0 0 2 -1
            "></feColorMatrix>
        </filter>
    </svg>
</body>

</html>

style.css

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    position: relative;
    width: 500px;
    display: flex;
    filter: url(#flt);  
    background-color: bisque;
}

.container .circle {
    background-color: #000;
    width: 200px;
    height: 200px;
    position: relative;
    border-radius: 50%;
    animation: leftM 5s ease-in-out 2s forwards;
}

svg {
    display: none;
}

@keyframes leftM {
    0% {
        transform: translateX(0px);
    }

    100% {
        transform: translateX(600px);
    }
}

当我注释掉style.css中.container的filter: url(#flt);属性时,黑色圆形能正常从容器中滚出;但添加该属性后,圆形在滚动过程中会短暂消失,我无法找到原因,特此求助。

效果截图

  • 圆形滚动正常状态
  • 圆形短暂消失状态
  • 圆形滚出容器状态

内容的提问来源于stack exchange,提问作者test1229

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 18:47:02