// À©µµ¿ì À̺¥Æ® $(window).load(function() { /*var elem = $(".scrollreveal"); var sty = { 'opacity':'0', 'transition':'none' } elem.css(sty); $("html, body").animate({scrollTop:'10'}, 10, function() { $("html, body").animate({scrollTop:'0'}, 0); });*/ // ½ºÅ©·Ñ½Ã ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® $(window).bind('scroll', function() { var winWidth = $(this).width(); var winTop = $(this).scrollTop(); var hdHeight = $("#header_new").height(); if(winWidth > 1024) { if(winTop >= hdHeight) { if(!$("#header_new").hasClass('fixed2')) { $("#header_new").addClass('fixed2'); } } else { $("#header_new").removeClass('fixed2'); } } }); }); $(function() { $("#callNav").click(function() { var gnb = $("#gnb"); if(!$(this).hasClass('active')) { $(this).addClass('active'); gnb.stop(true,false).animate({right:0}, 300, 'easeOutQuart'); $("body").addClass('scroll'); } else { $(this).removeClass('active'); gnb.stop(true,false).animate({right:'-100%'}, 300, 'easeInQuart'); $("body").removeClass('scroll'); } }); $("#gnb ul.nav > li").bind('click mouseenter mouseleave', function(e) { var winWidth = $(window).width(); if(e.type === 'mouseenter') { if(winWidth > 768) { $("#gnb ul.nav > li > ul.sub").stop(true,false).fadeOut(200); $("#gnb ul.nav > li").removeClass('on'); $(this).addClass('on'); $(this).find('ul.sub').stop(true,false).fadeIn(200); } } else if(e.type === 'mouseleave') { if(winWidth > 768) { $("#gnb ul.nav > li > ul.sub").stop(true,false).fadeOut(200); $("#gnb ul.nav > li").removeClass('on'); } } else if(e.type === 'click') { if(winWidth < 769) { if(!$(this).hasClass('on')) { e.preventDefault(); $("#gnb ul.nav > li > ul.sub").stop(true,false).fadeOut(200); $("#gnb ul.nav > li").removeClass('on'); $(this).addClass('on'); $(this).find('ul.sub').stop(true,false).fadeIn(200); } else { $(this).removeClass('on'); $(this).find('ul.sub').stop(true,false).fadeOut(200); } } } }); /* ÀÌÀü ¸Þ´º ¼Ò½º (¹é¾÷¿ë) $("#gnb ul.nav > li").mouseenter(function() { $("#gnb ul.nav > li > ul.sub").stop(true,false).fadeOut(200); $("#gnb ul.nav > li").removeClass('on'); $(this).addClass('on'); $(this).find('ul.sub').stop(true,false).fadeIn(200); }); $("#gnb ul.nav > li").mouseleave(function(e) { $("#gnb ul.nav > li > ul.sub").stop(true,false).fadeOut(200); $("#gnb ul.nav > li").removeClass('on'); }); */ $("#scrollTop a").click(function(e) { e.preventDefault(); $("html, body").stop(true,true).animate({scrollTop:0}, 600, 'easeOutQuart'); }); /*function subActive() { var winWidth = $(window).width(); if(!$("body").hasClass('main')) { $("#callNav").addClass('sub'); //$("#header h1 img").attr('src','/theme/websre10/img/logo_color.png'); } else { $("#callNav").removeClass('sub'); $("#header h1 img").attr('src','/theme/websre09/img/logo-w.png'); //¸ÞÀηΰí°æ·Î if(winWidth < 768) { $("#header h1 img").attr('src','/theme/websre09/img/logom-w.png'); //¸ÞÀηΰí°æ·Î(¸ð¹ÙÀÏÀ϶§) } } if(!$("body").hasClass('main') && $("#container").hasClass('visual')) { $("#header h1 img").attr('src','/theme/websre09/img/logo-w.png'); //¹è°æÀÌ ¾îµÎ¿ï¶§ ·Î°í°æ·Î if(winWidth < 768) { $("#header h1 img").attr('src','/theme/websre09/img/logom-w.png'); //¹è°æÀÌ ¾îµÎ¿ï¶§ ·Î°í°æ·Î(¸ð¹ÙÀÏÀ϶§) } } else if(!$("body").hasClass('main') && !$("#container").hasClass('visual')) { $("#header h1 img").attr('src','/theme/websre09/img/logo.png'); //¹è°æÀÌ ¹àÀ»¶§ ·Î°í°æ·Î if(winWidth < 768) { $("#header h1 img").attr('src','/theme/websre09/img/logom.png'); //¹è°æÀÌ ¹àÀ»¶§ ·Î°í°æ·Î(¸ð¹ÙÀÏÀ϶§) } } }*/ //gnbActive(); //subActive(); }); $(function() { function textEffect() { $("ul.text_effect p .color1").stop(true,false).animate({width:'100%'}, 1000, 'easeInOutCubic', function() { $("ul.text_effect p .color2").stop(true,false).animate({width:'100%'}, 1000, function() { $("ul.text_effect p .color1").css({width:0}); $("ul.text_effect p .color2").css({width:0}); textEffect(); }); }); } if($("#sub_visual .visual_tit").length > 0) { $("#sub_visual .visual_tit ul p").animate({left:'-200px', opacity:0}); $("#sub_visual .visual_tit ul").animate({left:'-200px', opacity:0}, 0, function() { $("#sub_visual .visual_tit ul").animate({left:'0', opacity:1}, 800); $("#sub_visual .visual_tit ul p").animate({left:'0', opacity:1}, 1000); }); } if($("ul.text_effect").length > 0) { textEffect(); } }); $(function() { var photoIndex = 1; var swipeIndex = 0; if($("#photo_swipe").length > 0) { var wSize = $("#photo_swipe").width(); var count = $("#photo_swipe ul li").length; $("#photo_swipe ul").css({width:wSize * count + 'px'}); $("#photo_swipe ul li").css({width:wSize+'px'}); } function slide_resize(img) { var zh = 64; var vh = (img.height() - zh) / 2; img.find('.zoom').css({top:vh + 'px'}); } function slide_init() { var pcount = Math.ceil($("#photo_list li").length / 4); var mcount = $("#photo_swipe ul li").length; $("#container .section_con .photo_slide .paging span.all").text(pcount); $("#container .section_con .photo_slide .paging_m span.all").text(mcount); } function photo_slide() { var count = Math.ceil($("#photo_list li").length / 4); var mcount = $("#photo_swipe ul li").length; var imgSize = $("#photo_swipe ul li:first").width(); if(photoIndex<1) { photoIndex = 1; } else if(photoIndex>count) { photoIndex = count; } else { $("#photo_list li").css({display:'none'}); $("#photo_list li.page" + photoIndex).css({display:'block'}); $("#container .section_con .photo_slide .paging span.current").text(photoIndex); } } function swipe_left() { var imgSize = $("#photo_swipe ul li:first").width(); var mcount = $("#photo_swipe ul li").length; if(swipeIndex<0) { swipeIndex = mcount - 1; } $("#photo_swipe ul").css({left:-imgSize+'px'}); $("#photo_swipe ul li:first").before($("#photo_swipe ul li:last")); $("#photo_swipe ul").stop(true,false).animate({left:0}, 300, 'easeOutCubic', function() { $("#container .section_con .photo_slide .paging_m span.current").text(swipeIndex+1); }); } function swipe_right() { var imgSize = $("#photo_swipe ul li:first").width(); var mcount = $("#photo_swipe ul li").length; if(swipeIndex>=mcount) { swipeIndex = 0; } $("#photo_swipe ul").stop(true,false).animate({left:-(imgSize) + 'px'}, 300, 'easeOutCubic', function() { $("#photo_swipe ul li:last").after($("#photo_swipe ul li:first")); $("#photo_swipe ul").css({left:0}); $("#container .section_con .photo_slide .paging_m span.current").text(swipeIndex+1); }); } $("#photo_prev").click(function() { photoIndex--; photo_slide(); }); $("#photo_next").click(function() { photoIndex++; photo_slide(); }); $("#photo_prev_m").click(function() { swipeIndex--; swipe_left(); }); $("#photo_next_m").click(function() { swipeIndex++; swipe_right(); }); if($("#photo_swipe").length > 0) { $("#photo_swipe").swipe({ swipe:function(event, direction, distance, duration, fingerCount, fingerData) { if(direction == "left"){ swipeIndex++; swipe_right(); } else if(direction == "right"){ swipeIndex--; swipe_left(); threshold:0 } } }); } $("#photo_list li").mouseenter(function() { $(this).find('a').css({display:'block'}); slide_resize($(this)); }).mouseleave(function() { $(this).find('a').css({display:'none'}); }); slide_init(); }); $(function() { var popIndex = 0; var popCount = $("#imgPopup .img_wrap ul li").length; function popImgFade() { if(popIndex < 0) { popIndex = popCount - 1; } else if(popIndex >= popCount) { popIndex = 0; } var imgTitle = $("#imgPopup .img_wrap ul li").eq(popIndex).find('img').attr('alt'); console.log(popIndex); $("#imgPopup .img_wrap ul li").removeClass('on'); $("#imgPopup .img_wrap ul li").eq(popIndex).css({opacity:0}); $("#imgPopup .img_wrap ul li").stop(true,true).eq(popIndex).animate({opacity:1}, 500, 'easeOutCubic'); $("#imgPopup .img_wrap ul li").eq(popIndex).addClass('on'); $("#imgPopup p.tit").text(imgTitle); } $("#img_popup_wrap .pop_prev").click(function() { popIndex--; popImgFade(); }); $("#img_popup_wrap .pop_next").click(function() { popIndex++; popImgFade(); }); $("#img_popup_wrap .pop_close").click(function() { $("#img_popup_wrap").css({visibility:'hidden'}); }); $("#photo_list li").click(function() { var idx = $(this).index(); var pop_w = ($(window).width() - $("#imgPopup").width()) / 2; var pop_h = ($(window).height() - $("#imgPopup").height()) / 2; popIndex = idx; $("#img_popup_wrap").css({display:'block', visibility:'visible'}); $("#imgPopup").css({left:pop_w + 'px', top:pop_h + 'px'}); popImgFade(); }); }); $(window).load(function() { if($("#sub_visual").length > 0) { $("#sub_visual img").addClass('load'); } }); $(window).scroll(function() { var _top = $(this).scrollTop(); if(_top > 40) { if(!$("#header").hasClass('scroll')) { $("#header").addClass('scroll'); $("#scrollTop").stop(true,false).fadeIn(300); } } else { $("#header").removeClass('scroll'); $("#scrollTop").stop(true,false). fadeOut(300); } }); $(window).resize(function() { if($("#photo_swipe").length > 0) { var wSize = $("#photo_swipe").width(); var count = $("#photo_swipe ul li").length; $("#photo_swipe ul").css({width:wSize * count + 'px', left:0}); $("#photo_swipe ul li").css({width:wSize + 'px'}); } if($("#imgPopup").length > 0) { var pop_w = ($(window).width() - $("#imgPopup").width()) / 2; var pop_h = ($(window).height() - $("#imgPopup").height()) / 2; $("#imgPopup").css({left:pop_w + 'px', top:pop_h + 'px'}); } }); $(window).load(function() { var elem = $(".scrollreveal"); var sty = { 'opacity':'0', 'transition':'none' } elem.css(sty); $("html, body").animate({scrollTop:'10'}, 10, function() { $("html, body").animate({scrollTop:'0'}, 0); }); $(window).bind('scroll', function() { var winWidth = $(this).width(); var winTop = $(this).scrollTop(); var winHeight = $(this).height(); var docHeight = $(document).height(); var hdHeight = $("#header").height(); var elemHeight; var showDelay = 0; elem.each(function() { var etop = $(this).offset().top; var eh = $(this).height(); var delay = $(this).data('delay'); if(delay == null) { delay = 100; } if(winTop >= etop - winHeight) { if(!$(this).hasClass('animated')) { var aniOptions; var styR = { 'position':'relative', 'top':'30px' } var sty = { 'top':'30px' } if($(this).css('position') == 'static') { aniOptions = { 'opacity':'1', 'top':'0' } $(this).css(styR); } else if($(this).css('position') == 'absolute') { aniOptions = { 'opacity':'1', } } else { aniOptions = { 'opacity':'1', 'top':'0' } $(this).css(sty); } showDelay += delay; $(this).stop().delay(showDelay).animate(aniOptions, 500, function() { var sty = { 'position':'', 'top':'', 'opacity':'', 'transition':'' } $(this).css(sty); }); $(this).addClass('animated'); } } }); }); }); $(window).load(function() { $("#page-loader").fadeOut(600, function() { $("#page-loader").delay(100).remove(); }); });