$(function () { if (!$("body").hasClass("main")) { $("#logo a img").attr("src", "../img/logo.png"); } if ($(window).width() < 1024) { if ($("body").hasClass("main")) { $("#logo a img").attr("src", "./img/logom-w.png"); } else { $("#logo a img").attr("src", "../img/logom.png"); } } $("#header .header_utils ul > li.list_item") .mouseenter(function () { $(this).addClass("on"); $(this).find("ul.sub").css({ display: "block" }); }) .mouseleave(function () { $(this).removeClass("on"); $(this).find("ul.sub").css({ display: "none" }); }); $("#header .header_utils ul > li > ul.sub > li") .mouseenter(function () { $(this).find("span").css({ display: "block", width: "100%", opacity: "0" }); $(this).find("span").stop(true, true).animate({ width: "100px", opacity: 1 }, 150); }) .mouseleave(function () { $(this).find("span").css({ display: "none" }); $(this).find("span").css({ width: "100%", opacity: 0 }); }); $("#lnb > ul > li").mouseenter(function () { $("#lnb .sub").css({ display: "none" }); $("#lnb > ul > li").removeClass("on"); $(this).addClass("on"); $(this).find("ul.sub").css({ display: "block" }); }); $("#header_wrap").mouseleave(function () { $("#lnb .sub").css({ display: "none" }); $("#lnb > ul > li").removeClass("on"); }); $("#lnb > ul > li > ul.sub > li") .mouseenter(function () { var pos = $(this).offset().left - $("#lnb").offset().left; var size = $(this).width(); $(".lnb_line") .stop(true, true) .animate({ left: pos + "px", width: size + "px", opacity: "1" }, 400); }) .mouseleave(function () { $(".lnb_line").stop(true, true).animate({ opacity: "0" }, 400); }); $("#call_menu, #open_sitemap").click(function () { var closebtn; if ($("body").hasClass("main")) { closebtn = "Àüü¸Þ´º ´Ý±â"; } else { closebtn = "Àüü¸Þ´º ´Ý±â"; } if (!$("#header_sitemap").is(":visible")) { $("#scrollTo").css({ display: "none" }); if ($("body").hasClass("main")) { $("#header_wrap").addClass("sitemap"); } $("#header_sitemap").css({ display: "block" }); if ($(window).width() > 1024) { $("body").css({ "overflow-y": "hidden" }); } $("#header_sitemap .inner").append(closebtn); $("#header_sitemap .inner .btn_close").delay(200).animate({ right: "50px", opacity: "1", rotate: "-180deg" }, 600, "easeOutCubic"); } else { sitemap_close(); } }); function sitemap_close() { $("#header_wrap").removeClass("sitemap"); $("#header_sitemap").css({ display: "none" }); $("#header_sitemap .inner .btn_close").remove(); if ($(window).width() > 1024) { $("body").css({ "overflow-y": "auto" }); } $("#scrollTo").css({ display: "block" }); } $(document).on("mouseenter", "#header_sitemap .inner .btn_close", function () { $(this).filter(":not(:animated)").stop(true, false).animate({ rotate: "0deg" }, 300, "easeInCubic"); }); $(document).on("mouseleave", "#header_sitemap .inner .btn_close", function () { $(this).stop(true, false).animate({ rotate: "-180deg" }, 300, "easeOutCubic"); }); $(document).on("click", "#header_sitemap .inner .btn_close", function () { sitemap_close(); }); $("#header .header_sitemap .inner > ul > li > h2 > a").click(function () { if ($(window).width() <= 1024) var winSize = $(window).width(); $("#header .header_sitemap .inner > ul > li > h2 > a").removeClass("on"); $("#header .header_sitemap .inner > ul > li > ul").css({ display: "none" }); $(this).addClass("on"); $(this) .parent() .next("ul") .css({ width: winSize + "px", display: "block" }); }); $("#header .header_sitemap .inner > ul > li > ul.depth1 > li > h3 > a").click(function (e) { if ($(window).width() <= 1024) { if ($(this).find(".more").length > 0) { e.preventDefault(); if ($(this).find(".more").hasClass("active")) { $(this).find(".more").removeClass("active"); $(this).parents("h3").nextAll("ul").stop(true, false).slideUp(200); } else { $(this).find(".more").addClass("active"); $(this).parents("h3").nextAll("ul").stop(true, false).slideDown(200); } } } }); $("#header_wrap .header_tit_bar .more a").click(function () { if ($("#header_wrap .header_tit_bar .menu_list").is(":visible")) { $(this).parents(".bar").next(".menu_list").css({ display: "none" }); } else { $(this).parents(".bar").next(".menu_list").css({ display: "block" }); } }); $("#nav_scroll ul li.dropdown") .mouseenter(function () { $(this).find("div.dropdown_list").css({ display: "block" }); }) .mouseleave(function () { $(this).find("div.dropdown_list").css({ display: "none" }); }); $("#playClip").click(function () { var vSource = ''; $("#videoClose").css({ display: "block" }); $("#videoClose").animate({ left: "-50px", rotate: "-360deg" }, 200); $("#videoClip").html(vSource); $("#videoClip").css({ display: "block" }); }); $("#videoClose") .mouseenter(function () { $(this).find("img").attr("src", "../img/video_close_on.png"); $(this) .find("img") .stop(true, false) .animate({ scale: "1.1" }, 150, function () { $(this).stop(true, false).animate({ scale: "1" }, 150); }); }) .mouseleave(function () { $(this).find("img").attr("src", "/theme/websre06/img/video_close.png"); }) .click(function () { $(this).animate({ left: "20px", rotate: "0" }, 200, function () { $(this).css({ display: "none" }); }); $("#videoClip").css({ display: "none" }); $("#videoClip").html(""); }); $("#scrollTo").click(function () { $("html, body").animate({ scrollTop: 0 }, 500); }); $("#footer .right_con .dropdown > li > a").click(function () { var target = $(this).next("ul"); if (target.css("display") === "block") { target.css({ display: "none" }); } else { target.css({ display: "block" }); } }); 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" }); } }); $(function () { /*$("#container .aside ul > li > h3 > a, #container .aside ul > li > ul > li > h4 > a").click(function () { if (!$(this).hasClass("on")) { $(this).addClass("on"); $(this).parent().nextAll("ul").stop(true, false).slideDown(200); } else { $(this).removeClass("on"); $(this).parent().nextAll("ul").stop(true, false).slideUp(200); } });*/ $("#container .aside ul > li > h3 > a, #container .aside ul > li > ul > li > h4 > a").bind("click mouseenter mouseleave", function (e) { var winWidth = $(window).width(); if (e.type === "click") { if (winWidth < 769) { if (!$(this).hasClass("on")) { e.preventDefault(); $(this).addClass("on"); $(this).parent().nextAll("ul").stop(true, false).slideDown(200); } else { e.preventDefault(); $(this).removeClass("on"); $(this).parent().nextAll("ul").stop(true, false).slideUp(200); } } } }); // À©µµ¿ì ¸®»çÀÌ¡ ó¸® $(window).bind('resize', function() { var $winWidth = $(this).width(); if($winWidth > 1024) { $("#container .aside ul").removeAttr('style'); } else { } }); }); $(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).scroll(function () { if ($(window).scrollTop() > 111) { $("#scrollTo").css({ display: "block" }); if ($("body").hasClass("main")) { $("#header_wrap").stop(true, false).fadeOut(200); } if (!$("#nav_scroll").hasClass("active")) { $("#nav_scroll").addClass("active"); $("#nav_scroll").css({ top: "-42px" }); $("#nav_scroll").css({ top: "0" }, 500); //$("#nav_scroll").animate({ top: "0" }, 500); if ($("body").hasClass("main")) { $("#nav_scroll ul li.home a img").attr("src", "./img/nav_logo.png"); } else { $("#nav_scroll ul li.home a img").attr("src", "../img/nav_logo.png"); } } } else { if (!$("body").hasClass("main")) { $("#nav_scroll ul li.home a img").attr("src", "../img/nav_logo_cl.png"); } $("#nav_scroll").css({ top: "111px" }); $("#nav_scroll").removeAttr("style").removeClass("active"); $("#header_wrap").stop(true, false).fadeIn(200); $("#scrollTo").css({ display: "none" }); } }); $(window).resize(function () { /*if ($(this).width() < 1007) { if ($("body").hasClass("main")) { $("#logo a img").attr("src", "./img/logo_color.png"); } else { $("#logo a img").attr("src", "./img/logo_color.png"); } } else { if ($("body").hasClass("main")) { $("#logo a img").attr("src", "./img/logo.png"); } }*/ if ($(this).width() < 1025) { $("#header .header_sitemap .inner > ul > li > ul").css({ width: $(this).width() + "px" }); } 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 () { if ($("#sub_visual").length > 0) { $("#sub_visual img").addClass("load"); } }); $(function () { if ($(".brd_photo_list").length > 0) { $(".brd_photo_list > table:last").remove(); for (i = 0; i < 3; i++) { $(".brd_photo_list").append('
'); } } }); $(window).load(function () { $("#page-loader").fadeOut(600, function () { $("#page-loader").delay(100).remove(); }); });