$(document).ready(function(){ $(".subtittxt h2").addClass('wow animated fadeInDown'); $(".subtittxt p").addClass('wow animated fadeIn'); $('.glist4t').find("a").click(function(e) { e.preventDefault(); }); $(".sec-title h2").addClass('wow animated fadeInUp'); $(".sec-title p").addClass('wow animated fadeInUp'); }); //스크롤스파이 $(function(){ var $menu = $('.floating-menu li.m'), $contents = $('.scroll'), $doc = $('html, body'); $(function () { $menu.on('click','a', function(e){ var $target = $(this).parent(), idx = $target.index(), section = $contents.eq(idx), offsetTop = section.offset().top; $doc.stop() .animate({ scrollTop :offsetTop }, 800); return false; }); }); $(window).scroll(function(){ var scltop = $(window).scrollTop(); $.each($contents, function(idx, item){ var $target = $contents.eq(idx), i = $target.index(), targetTop = $target.offset().top-303; if (targetTop <= scltop) { $menu.removeClass('on'); $menu.eq(idx).addClass('on'); } if (!(200 <= scltop)) { $menu.removeClass('on'); } }) }); var btnTop = $('.btn-top'); btnTop.on('click','a', function(e){ e.preventDefault(); $doc.stop() .animate({ scrollTop : 0 },800) }); });