How to prevent flash on end of transition on filter: blur effect? (I'm using chrome) Snippet below to show problem.
$(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>
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>
来源:https://stackoverflow.com/questions/50249520/how-to-prevent-image-flash-when-transitioning-with-blur