Image blur with CSS/[removed] is it possible?

后端 未结 7 565
臣服心动
臣服心动 2021-02-01 05:47

Is it possible to add a blur effect to an image using CSS and Javascript?

7条回答
  •  Happy的楠姐
    2021-02-01 06:15

    Try this:

    let blur = document.querySelector("#blur");
    let girlImg = document.querySelector("#girlImg");
    
    blur.addEventListener('input', blurring);
    function blurring(){
        girlImg.style.filter = `blur(${blur.value}px)`
    }
    Blur:

    girlImg

提交回复
热议问题