$(window).on('resize',function(){ response(); imgPosition(); setTimeout(imgPosition,100); }); (function( $ ) { $.fn.keepRatio = function(which) { var $this = $(this); var w = $this.width(); var h = $this.height(); var ratio = w/h; $(window).resize(function() { switch(which) { case 'width': var nh = $this.width() / ratio; $this.css('height', nh + 'px'); break; case 'height': var nw = $this.height() * ratio; $this.css('width', nw + 'px'); break; } }); } })( jQuery ); function goTop() { $(window).scrollTop(0) ; } function init() { TweenMax.to("#header", 0.5, { opacity:"1", ease:"easeOutQuad", delay: 0}) TweenMax.to("#gnb.on", 0.5, { display:"block", ease:"easeOutQuad", delay: 0}) //main TweenMax.to("#content", 0.2, {opacity:"1", ease:"easeOutQuad", delay:0}) //sub TweenMax.to(".sub #section1", 0.5, { opacity:"1", ease:"easeOutQuad", delay: 0}) //room_preview } $(window).load(function() { //setInterval(function(){ $(".main_arrow").fadeOut(); }, 10000,'swing'); //setInterval(function(){ $("#icon_wheel").fadeOut(); }, 5000,'swing'); }) ; // url 입렵창 숨기기 //window.addEventListener('load', function(){ setTimeout(scrollTo, 0, 0, 1);}, false); // 회전 //window.onorientationchange = function() { location.reload() }; // iframe resize function autoResize(i) { var iframeHeight= (i).contentWindow.document.body.scrollHeight; (i).height=iframeHeight+20; } var active = { init : function(){ active.winScroll(); }, winScroll : function(){ var myWin = $(window), section = $('.section'); myWin.on('load scroll', function(){ var winTop = $(this).scrollTop(), winH = $(this).height(); // image loader section.each(function(){ var tg = $(this), tgTop = tg.offset().top + 80; if(tgTop <= winTop+winH){ tg.addClass('active'); } else if(tgTop >= winTop+winH){ tg.removeClass('active'); } }); }); } } $(function(){ active.init(); }); $(function(){ $('#skip a').on('focus',function(){ $(this).parent().addClass('on'); }).on('blur',function(){ $(this).parent().removeClass('on'); }); }); $(function(){ response(); setTimeout(response,1500); setTimeout(imgPosition,1700); setTimeout(selectorSet,1700); }); function response(){ var screenW=$(window).width(); var screenH=$(window).height(); if(screenW<=560){ $('body').removeClass().addClass('mobile mobile560'); $('.topArea, .topArea .lightSlider li').css({'height':screenW*0.5}); setTimeout(selectorSet,100); if($('.maindata').length==1){ mainPackageSetMobile(); mainNewsSetMobile(); } } else if(screenW<=768){ $('body').removeClass().addClass('mobile mobile768'); $('.topArea, .topArea .lightSlider li').css({'height':screenW*0.5}); //$('.map_01').css({'height':screenW*0.6}); setTimeout(selectorSet,100); } else if(screenW<=1024){ $('body').removeClass().addClass('tablet'); $('.topArea, .topArea .lightSlider li').css({'height':screenW*0.45}); //$('.map_01').css({'height':screenW*0.6}); } else if(screenW<=1280){ $('body').removeClass().addClass('web web1280'); $('.topArea, .topArea .lightSlider li').css({'height':screenW*0.365}); //$('.map_01').css({'height':screenW*0.6}); setTimeout(selectorSet,100); } else if(screenW<=1480){ $('body').removeClass().addClass('web web1480'); $('.topArea, .topArea .lightSlider li').css({'height':screenW*0.365}); //$('.map_01').css({'height':screenW*0.5}); setTimeout(selectorSet,100); } else if(screenW>1480){ $('body').removeClass().addClass('web'); $('.topArea, .topArea .lightSlider li').css({'height':screenW*0.365}); //$('.map_01').css({'height':screenW*0.5}); setTimeout(selectorSet,100); } } function imgPosition(){ var width=$(window).width(); var height=$(window).height(); if($('body').hasClass('mobile')){ $('').css({'marginTop':'0'}); }else{ $('').each(function(){ $('').css({'marginTop':'0'}); }); } } function selectorSet(){ if($('body').hasClass('mobile')){ } } $(function(){ $('#header').on('mouseenter',function(){ if($('body').hasClass('mobile')){ }else{ } }).on('mouseleave',function(){ if($('body').hasClass('mobile')){ }else{ $(".main .headerBg_sub").fadeOut(0); $(".this .gnb_sub").fadeIn(0); } }); $('.gnb > li').on('mouseenter',function(){ if($('body').hasClass('mobile')){ }else{ $(this).addClass('on'); $(this).find('>ul').fadeIn(0); $('.gnb_sub').not(".on .gnb_sub").fadeOut(0); } }).on('mouseleave',function(){ if($('body').hasClass('mobile')){ }else{ $(this).removeClass('on'); $(this).find('>ul').fadeOut(0); } }).on('keyup',function(){ if($('body').hasClass('mobile')){ }else{ $(this).parent().find('>li').removeClass('on'); $(this).addClass('on'); } }); $('.header_btn li.gnb2 > ul > li').on('mouseenter',function(){ if($('body').hasClass('mobile')){ }else{ $(this).addClass('on'); $(this).find(".gnb_sub li.on > .gnb_third").css("height","50px"); $(this).css("padding-bottom","50px"); $(".gnb_sub li:first-child").css("padding-bottom","0"); } }).on('mouseleave',function(){ if($('body').hasClass('mobile')){ }else{ $(this).removeClass('on'); $(this).css("padding-bottom","0"); } }).on('keyup',function(){ if($('body').hasClass('mobile')){ }else{ $(this).addClass('on'); $(this).find(".gnb_sub li.on > .gnb_third").css("height","50px"); $(this).css("padding-bottom","50px"); $(".gnb_sub li:first-child").css("padding-bottom","0"); } }); //btn_top $("a.btn_top").click(function(){ $('html, body').stop().animate({scrollTop:0}, 600, "easeInOutQuart"); return false; }); $("a.btn_scroll").click(function(e){ e.preventDefault(); var position = $(this.hash).offset(); $('html, body').animate({scrollTop : position.top}, 600, "easeInOutQuart"); }); $("a.btn_down").click(function(e){ e.preventDefault(); var position = $("#section1").offset(); $('html, body').animate({scrollTop : position.top}, 400); }); $('.btn_nav').on('click',function(){ if($('#header').is(':animated')){ }else{ if($(this).hasClass('open_nav')){ $('.btn_nav').removeClass('open_nav'); $('#header').removeClass('open_nav'); }else{ $('.btn_nav').addClass('open_nav'); $('#header').addClass('open_nav'); } } return false; }); $('.special_list01 a').on('mouseenter',function(){ var cl_name = $(this).attr("class"); $('.special_list02').find("."+cl_name).addClass('on'); $('.special_list02 li').not("."+cl_name).removeClass('on'); return false; }); $('.special_list01 a').on('mouseleave',function(){ var cl_name = $(this).attr("class"); $('.special_list02 li').not("."+cl_name).removeClass('on'); return false; }); });