如何在过滤器结束时防止闪光:模糊效果? (我正在使用chrome) 下面的代码段显示问题。
$(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;
-webkit-filter: blur(20px);
-moz-filter: blur(20px);
-o-filter: blur(20px);
-ms-filter: blur(20px);
filter: blur(20px);
}
.sec.active {
-webkit-filter: blur(0px);
-moz-filter: blur(0px);
-o-filter: blur(0px);
-ms-filter: blur(0px);
filter: blur(0px);
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>
答案 0 :(得分:1)
一个想法是避免blur
转到0,您可能会认为某个值接近0.5px
$(window).on('load', function(event) {
setTimeout(function() {
$('.sec').addClass('active')
}, 1000)
})
&#13;
.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;
}
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="sec">
</div>
&#13;