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

后端 未结 7 1770
忘掉有多难
忘掉有多难 2021-02-01 05:28

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

7条回答
  •  野性不改
    2021-02-01 06:01

    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

提交回复
热议问题