$(function(){ if(window.innerWidth>1024){ new WOW().init(); } $('.tel-wrap').hover(function(){ // if(window.innerWidth>1024){ $(this).find('.tel-dialog').stop().fadeIn(); // } },function(){ // if(window.innerWidth>1024){ $(this).find('.tel-dialog').stop().fadeOut(); // } }) $('.nav-btn').on('click',function(){ if($(this).hasClass('cur')){ $(this).removeClass('cur'); $('.m-nav').stop().slideUp(); }else{ $(this).addClass('cur'); $('.m-nav').stop().slideDown(); } }); $('.m-nav li .tit').on('click',function(){ var _this = $(this); var thisLi = _this.parent(); if(thisLi.hasClass('on')){ thisLi.removeClass('on'); _this.next().stop().slideUp(); }else{ thisLi.addClass('on').siblings().removeClass('on'); $('.m-nav li .navson').stop().slideUp(); _this.next().stop().slideDown(); } }) // var tel = $('.tel-btn').data('tel'); // if(window.innerWidth<1025){ // $('.tel-btn').attr('href','tel:'+tel); // }else{ // $('.tel-btn').attr('href','javascript:;'); // } $(window).on('resize',function(){ if(window.innerWidth<1025){ $('.tel-btn').attr('href','tel:'+tel); }else{ $('.tel-btn').attr('href','javascript:;'); } }) $('.tel-btn').on('click',function(){ if(window.innerWidth>1024){ var _this = $(this); var telWrap = _this.parent(); if(telWrap.hasClass('on')){ telWrap.removeClass('on'); _this.next().stop().fadeOut(); }else{ telWrap.addClass('on'); _this.next().stop().fadeIn(); } } }) $('.pc-nav li').hover(function(){ $(this).find('.navson').stop().fadeIn(); },function(){ $(this).find('.navson').stop().fadeOut() }) $('.share-box .icon').on('click',function(){ var _this = $(this); var thisItem = _this.parent(); if(window.innerWidth<1025){ if(thisItem.hasClass('cur')){ thisItem.removeClass('cur'); }else{ thisItem.addClass('cur').siblings().removeClass('cur'); } } }) var winTop = $(window).scrollTop(); if(winTop>0){ $('header').addClass('on'); }else{ $('header').removeClass('on'); } $(window).on('scroll',function(){ winTop = $(window).scrollTop(); if(winTop>0){ $('header').addClass('on'); }else{ $('header').removeClass('on'); } }) $('.search-btn').on('click',function(){ var _this = $(this); if(_this.hasClass('on')){ _this.removeClass('on'); _this.next().stop().fadeOut(); }else{ _this.addClass('on'); _this.next().stop().fadeIn(); } }) }); function subnav(){ subnavSwiper = new Swiper('.sub-nav',{ slidesPerView:"auto", initialSlide:$('.sub-nav .swiper-slide.cur').index() }) } $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.85) { _this.addClass('animate'); } }); $(window).scroll(function() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.85) { _this.addClass('animate'); } }); });