$(function(){ //フェードインダウン $('.scr_move').css('visibility','hidden'); $(window).scroll(function(){ var windowHeight = $(window).height(), topWindow = $(window).scrollTop(); $('.scr_move').each(function(){ var targetPosition = $(this).offset().top; if(topWindow > targetPosition - windowHeight + 100){ $(this).addClass("fadeInDown"); } }); }); //フェードインアップ $('.scr_moveup').css('visibility','hidden'); $(window).scroll(function(){ var windowHeight = $(window).height(), topWindow = $(window).scrollTop(); $('.scr_moveup').each(function(){ var targetPosition = $(this).offset().top; if(topWindow > targetPosition - windowHeight + 100){ $(this).addClass("fadeInUp"); } }); }); //menu $("#han_menu,#topNav a").on('click', function(){ if($('#topNav').css('display') === 'none'){ $("#topNav").fadeIn("slow"); $("#han_menu").addClass("active"); } else { $("#han_menu").removeClass("active"); $("#topNav").fadeOut("slow"); } }); }); //document ready close