$(document).ready(function(){ // navbtn jQuery(function() { jQuery( "#header_menu" ).click( function() { jQuery( "#all_menu" ).animate({left: 0}, 500 ); } ); jQuery( "#menu_close" ).click( function() { jQuery( "#all_menu" ).animate({left: '-274'}, 500 ); } ); }); $(function(){ $('.menu').click(function(){ if($(this).next().css('display')=='none'){ $('.sub').slideUp('fast'); } $('.menu').removeClass('selected'); $(this).addClass('selected').next().slideToggle('fast'); }) }) // topbtn let $topBtn = $('.top-btn'); $topBtn.hide(); $(window).scroll(function(){ if ($(this).scrollTop() > 100 ) { $topBtn.fadeIn(); } else { $topBtn.fadeOut(); } }); $topBtn.click(function(){ $('html, body').stop().animate({ scrollTop: 0 }, 500); }); //메인 슬라이더 var swiper = new Swiper(".mySwiper", { loop:true, loopAdditionalSlides : 1, speed: 1500, effect : 'fade', autoplay: { delay: 3000, disableOnInteraction: false, }, navigation : { nextEl : '.swiper-button-next', prevEl : '.swiper-button-prev', }, }); // 서브페이지 rooms var swiper2 = new Swiper(".room_Swiper", { loop:true, loopAdditionalSlides : 1, autoplay: { delay: 3000, disableOnInteraction: false, }, pagination : { el : '.swiper-pagination', clickable : true, }, navigation : { nextEl : '.swiper-button-nextb', prevEl : '.swiper-button-prevb', }, }); let observer = new IntersectionObserver((e)=>{ e.forEach((box)=>{ if (box.isIntersecting){ box.target.style.opacity = 1; box.target.style.top = '25%'; } else { box.target.style.opacity = 0; box.target.style.top = '15%'; } }) }) let cont = document.querySelectorAll('.observer_cont') if(window.innerWidth > 768) { observer.observe(cont[0]); } // let winW = $(window).width(); $('.slick_rooms').slick({ slidesToShow: 3, slidesToScroll: 1, loop:true, loopAdditionalSlides : 1, autoplay: true, autoplaySpeed: 2000, pauseOnFocus: false, pauseOnHover: false, responsive: [ {breakpoint: 768, //화면 넓이 768px 이상 settings: { slidesToShow: 1, slidesToScroll: 1 }} ] }); $('#at_tab li').mouseenter(function(){ // $(this).css({'background-color':'#efefef'}).siblings().css({'background-color':'#fff'}); fa_num = $(this).index(); $('#at_img li').eq(fa_num).show().siblings().hide(); }); $(window).scroll(function() { if ($(this).scrollTop() > 900) { $('#side').css({'position':'fixed', 'top':'10%'}) } else { $('#side').css({'position':'absolute', 'top':'970px'}) } }); });