scroll-blur
HTML
<div class="scroll-space">
<div class="blur blue">
ぼかしが外れる
</div>
</div>
SCSS
.scroll-space{
box-sizing: border-box;
padding-top: 300px;
height: 700px;
color: #fff;
.blue{
background: #77BBCF;
width: 200px;
height: 200px;
padding: 30px;
margin: 0 auto 50px;
}
}
.blur{
transition: all 0.5s;
filter: blur(10px);
&.scrollin{
filter: blur(0);
}
}
JavaScript
$(window).scroll(function (){
$('.blur').each(function(){
var elemPos = $(this).offset().top,
scroll = $(window).scrollTop(),
windowHeight = $(window).height();
if (scroll > elemPos - windowHeight + 150){
$(this).addClass('scrollin');
}
});
});