How to prevent image flash when transitioning with blur?

試著忘記壹切 提交于 2019-12-02 09:24:38

An idea is to avoid the blur to go to 0, you may consider a value close like 0.5px

$(window).on('load', function(event) {
  setTimeout(function() {
    $('.sec').addClass('active')
  }, 1000)
})
.sec {
  margin: 0 auto;
  width: 700px;
  height: 500px;
  background-image: url(http://placekitten.com/700/500);
  background-size: cover;
  filter: blur(20px);
}

.sec.active {
  filter: blur(0.5px);
  transition: all 3s ease, transform 1s ease-out;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="sec">

</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!