/* header */ /* motion */ //jQuery.easing.motion = function (x, t, b, c, d) {if (t==0) return b;if (t==d) return b+c;if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;} /* current OS */ /* var isPositionFixed=1; */ //var isMobile=0; /* var isIE6=0; if (navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Windows CE/i) || navigator.userAgent.match(/Symbian/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) isMobile=1; if (navigator.userAgent.match(/Android 1.5/i) || navigator.userAgent.match(/Android 2.1/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) isPositionFixed=0; if (navigator.userAgent.match(/MSIE 6.0/i)) {isIE6=1;isPositionFixed=0;} function isTouchDevice(){try{document.createEvent("TouchEvent");return true;}catch(e){return false;}} function touchScroll(id){ if(isTouchDevice()){ //if touch events exist... if (document.getElementById(id)) { var el=document.getElementById(id); var scrollStartPos=0; document.getElementById(id).addEventListener("touchstart", function(event) { scrollStartPos=this.scrollTop+event.touches[0].pageY; event.preventDefault(); },false); document.getElementById(id).addEventListener("touchmove", function(event) { this.scrollTop=scrollStartPos-event.touches[0].pageY; event.preventDefault(); },false); } } } */ /* floating_menu */ $(window).load(function(e){ //scrollAnimation(); /* scroll event */ $(window).scroll(function(e){ // fixedPosition(); // fixedScroll(); }); /* scroll animation */ function scrollAnimation() { if(isMobile==0){ $('a[href*=#wrap], a[href*=#slide_content01], a[href*=#slide_content02], a[href*=#slide_content03], a[href*=#slide_content04], a[href*=#slide_content05], a[href*=#slide_content06], a[href*=#slide_content07], a[href*=#slide_content08], a[href*=#slide_content09], a[href*=#slide_content10], area[href*=#wrap], area[href*=#slide_content01], area[href*=#slide_content02], area[href*=#slide_content03], area[href*=#slide_content04], area[href*=#slide_content05], area[href*=#slide_content06], area[href*=#slide_content07], area[href*=#slide_content08] area[href*=#slide_content09] area[href*=#slide_content10]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; jQuery('html,body').animate({scrollTop:targetOffset}, {duration:500, easing:'motion'}); return false; } else { return true; } } else { return true; } }); } } function goToMyId(myid) { var target = $('div[id='+myid+']'); if (target.length){var top = target.offset().top; $('html,body').animate({scrollTop:top},{duration:1000,easing:'motion',complete:function() { fixedScroll(); changeSubmenu(); }}); return false; } } /* position */ function fixedPosition() { var w = parseInt(($(window).width)); if (w<0) w=0; if ($(window).scrollTop() > 100) { if (isPositionFixed==0) { $("#wrap #floating_menu").css("position","absolute"); } else { $("#wrap #floating_menu").css("position","fixed"); } } else { $("#wrap #floating_menu").css("position","absolute"); } } function fixedScroll() { var w = parseInt(($(window).width)); if (w<0) w=0; if ($(window).scrollTop() >= 100) { if (isPositionFixed==0) $("#wrap #floating_menu").css("top",$(window).scrollTop()-100); else $("#wrap #floating_menu").css("top",0); } else { $("#wrap #floating_menu").css("top",0); } } }); $(window).load(function() { $('input[type="text"]').focus(function() { $(this).css("border","1px solid #999").css("color","#666"); $(".txt_md").css("border","0 none"); if($(this).attr("class") == "mainSearch"){ this.value = ''; } }); $('input[type="text"]').blur(function() { $(this).css("border","1px solid #d5d5d5"); $(".txt_md").css("border","0 none"); if ($.trim(this.value) == ''){ //this.value = (this.defaultValue ? this.defaultValue : ''); } }); $('.mainSearch').focus(function() { $(".mainSearch").css("border","3px solid #A1C4C3"); if($(this).attr("class") == "mainSearch"){ this.value = ''; } }); $('.mainSearch').blur(function() { $(".mainSearch").css("border","3px solid #A1C4C3"); if ($.trim(this.value) == ''){ this.value = (this.defaultValue ? this.defaultValue : ''); } }); /* 상품카테고리 팝업창 슬라이드& 기본 슬라이드 * 모아세일 */ if($(".slideBox").length > 0){ $(".slideBox").each(function() { $(this).find("ul").css({"width" : $(this).find("li").eq(0).width() * $(this).find("li").length + (14 * $(this).find("li").length)}); }); } $(".slideBox .next").click(function() { if(!$(".slideContent ul").is(':animated')){ now_num = Math.abs(parseInt($(this).siblings(".slideContent").find("ul").css("left")) / 124); max_num = $(this).siblings(".slideContent").find("ul li").length - Math.ceil($(".slideContent").width() / 124); now_num++; if(now_num >= max_num){ now_num = max_num; } $(this).siblings(".slideContent").find("ul").animate({"left" : -124 * now_num + "px"}, 400); } return false; }); $(".slideBox .pre").click(function() { if(!$(".slideContent ul").is(':animated')){ now_num = Math.abs(parseInt($(this).siblings(".slideContent").find("ul").css("left")) / 124); now_num--; if(now_num < 0){ now_num = 0; } $(".slideContent ul").animate({"left" : -124 * now_num + "px"}, 400); } return false; }); /* png */ if(navigator.userAgent.indexOf("MSIE 6.0") > 0){ $("img[src$='.png']").each(function(){ if($(this).parent().attr("class") != "rBigImg" || $(this).parent().parent().parent().attr("class") != "logoSearch2"){ $(this).addClass("png24"); } }); } }); /* png */ function setPng24(obj) { obj.width = obj.height = 1; obj.className = obj.className.replace(/\bpng24\b/i,''); obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" obj.src = ''; return ''; } /* 탑메뉴 카테고리 모두보기 */ function category(xName) { /*tmp_src = document.getElementById("imgCate").src; if(tmp_src.indexOf("_on") > 0){ document.getElementById("imgCate").setAttribute("src", tmp_src.replace("_on", "_off")); }else{ document.getElementById("imgCate").setAttribute("src", tmp_src.replace("_off", "_on")); }*/ if(document.getElementById(xName).style.display == "block"){ document.getElementById(xName).style.display = "none"; }else{ document.getElementById(xName).style.display = "block"; } } /* dep 3개*/ /* function cate_Select(xName) { if(xName == "dep1"){ document.getElementById("dep1").style.display = "block"; document.getElementById("dep2").style.display = "none"; document.getElementById("dep3").style.display = "none"; document.getElementById("imgDep1").className = "Dep1 on"; document.getElementById("imgDep2").className = "Dep1"; document.getElementById("imgDep3").className = "Dep1"; }else{ document.getElementById("dep1").style.display = "none"; document.getElementById("dep2").style.display = "block"; document.getElementById("dep3").style.display = "none"; document.getElementById("imgDep1").className = "Dep1"; document.getElementById("imgDep2").className = "Dep1 on"; document.getElementById("imgDep3").className = "Dep1"; }else { document.getElementById("dep1").style.display = "none"; document.getElementById("dep3").style.display = "block"; document.getElementById("dep2").style.display = "none"; document.getElementById("imgDep1").className = "Dep1"; document.getElementById("imgDep3").className = "Dep1 on"; document.getElementById("imgDep2").className = "Dep1"; } } */ /* dep 2개*/ function cate_Select(xName) { if(xName == "dep1"){ document.getElementById("dep1").style.display = "block"; document.getElementById("dep2").style.display = "none"; document.getElementById("imgDep1").className = "Dep1 on"; document.getElementById("imgDep2").className = "Dep1"; }else{ document.getElementById("dep1").style.display = "none"; document.getElementById("dep2").style.display = "block"; document.getElementById("imgDep1").className = "Dep1"; document.getElementById("imgDep2").className = "Dep1 on"; } } /* */ function category_over(xName) { var temp3 = document.getElementById(xName); var tmp4_src = document.getElementById("imgCate").src; if (temp3.style.display == 'none'){ temp3.style.display='block'; document.getElementById("imgCate").setAttribute("src", tmp4_src.replace("_on", "_off")); } } function category_out(xName) { var temp4 = document.getElementById(xName); var tmp5_src = document.getElementById("imgCate").src; if (temp4.style.display == 'block'){ temp4.style.display='none'; document.getElementById("imgCate").setAttribute("src", tmp5_src.replace("_off", "_on")); } }