アニメーション
- 公開日:
- 更新日:
- 文字数:802文字
.scroll-fade-origin {
opacity : 0;
transform: translateY(-20px);
transition: all 1s;
}
.scroll-fade {
opacity : 0;
transform: translateY(0px);
transition: all 1s;
}
js
(function(){
$(window).scroll(function (){
$('.mask_animation').each(function(){
var targetElement = $(this).offset().top;
var scroll = $(window).scrollTop();
var windowHeight = $(window).height();
if (scroll > targetElement - windowHeight + 200){
//$(this).find('.mask_inner').addClass('start');
//$(this).addClass('start');
//$(this).css('opacity','1');
//$(this).css('transform','translate(-50%,-50%)');
//$(this).css('transform','translateY(0)');
}
});
});
});
