//메인메뉴 롤오버 이미지처리 $(function() { $(".gnbSub").hide(); // 2뎁스 메뉴를 모두 숨김 $(".gnbMain").hover(function(){ var Img = $(this).contents().contents("img").attr("src").replace("_off.", "_on."); // 1뎁스 이미지명을 찾아서 변경하여 변수에 저장 $(this).contents().contents("img").attr("src", Img); // 이미지명을 저장한 변수값으로 변경 $(this).contents("ul").stop().slideDown("fast"); // 2뎁스 노출 }, function(){ var Img = $(this).contents().contents("img").attr("src").replace("_on.", "_off."); // 1뎁스 이미지명을 찾아서 변경하여 변수에 저장 $(this).contents().contents("img").attr("src", Img); // 이미지명을 저장한 변수값으로 변경 $(this).contents("ul").stop().slideUp("fast");// 2뎁스 숨김 }); $(".gnbSub li").each(function(e){ $(this).mouseenter(function(e){ var subImg = $(this).contents().contents("img").attr("src").replace("_off.", "_on."); $(this).contents().contents("img").attr("src", subImg); }); $(this).mouseleave(function(e){ var subImg = $(this).contents().contents("img").attr("src").replace("_on.", "_off."); $(this).contents().contents("img").attr("src", subImg); }); }); }); // 왼쪽사이드바 서브메뉴 롤오버 이미지처리 $(function() { $(".lnbSub").hide(); // 2뎁스 메뉴를 모두 숨김 $(".lnbMain").hover(function(){ var Img = $(this).contents().contents("img").attr("src").replace("_off.", "_on."); // 1뎁스 이미지명을 찾아서 변경하여 변수에 저장 $(this).contents().contents("img").attr("src", Img); // 이미지명을 저장한 변수값으로 변경 $(this).contents("ul").stop().slideDown("fast"); // 2뎁스 노출 }, function(){ var Img = $(this).contents().contents("img").attr("src").replace("_on.", "_off."); // 1뎁스 이미지명을 찾아서 변경하여 변수에 저장 $(this).contents().contents("img").attr("src", Img); // 이미지명을 저장한 변수값으로 변경 $(this).contents("ul").stop().slideUp("fast");// 2뎁스 숨김 }); $(".lnbSub li").each(function(e){ $(this).mouseenter(function(e){ var subImg = $(this).contents().contents("img").attr("src").replace("_off.", "_on."); $(this).contents().contents("img").attr("src", subImg); }); $(this).mouseleave(function(e){ var subImg = $(this).contents().contents("img").attr("src").replace("_on.", "_off."); $(this).contents().contents("img").attr("src", subImg); }); }); }); // rollover이미지 처리 : right_sidebar $(function(){ $("img.rollover").mouseover(function(){ $(this).attr("src",$(this).attr("src").replace("_off.", "_on.")); }).mouseout(function(){ $(this).attr("src",$(this).attr("src").replace("_on.", "_off.")); }).each(function(){ $("").attr("src",$(this).attr("src").replace("_off.", "_on.")); }); }); //패밀리사이트 $(function() { $("#family_site").hide(); $(".family").click(function(){ $("#family_site").slideDown(); $("#family_site").mouseleave(function(){closeFamily();return false;}) } ); $("#family_site a.close").click(function(){closeFamily(); return false;}); $("#family_site").focusout( function(){ $("#family_site").slideDown(); } ); }); function closeFamily(){ $("#family_site").stop().slideUp(); } //슬라이딩배너 //new Floating(적용할개체 , X축여백 , Y축여백 , 미끄러지는속도:작을수록빠름..기본20 , 빠르기:작을수록부드러움..기본10); function Floating(FloatingObj,MarginX,MarginY,Percentage,setTime) { this.FloatingObj = FloatingObj; this.MarginX = (MarginX) ? MarginX : 0; this.MarginY = (MarginY) ? MarginY : 0; //this.MarginX = document.getElementById('body_cus').offsetLeft + 985; this.Percentage = (Percentage) ? Percentage : 15; this.setTime = (setTime) ? setTime : 10; this.FloatingObj.style.position = "absolute"; this.Body = null; this.setTimeOut = null; this.Run(); } Floating.prototype.Run = function () { if ((document.documentElement.scrollLeft + document.documentElement.scrollTop) > (document.body.scrollLeft + document.body.scrollTop)) { this.Body = document.documentElement; } else { this.Body = document.body; } var This = this; var FloatingObjLeft = (this.FloatingObj.style.left) ? parseInt(this.FloatingObj.style.left,10) : this.FloatingObj.offsetLeft; var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop; var DocLeft = this.MarginX; var DocTop = this.Body.scrollTop + this.MarginY; var MoveX = Math.abs(FloatingObjLeft - DocLeft); MoveX = Math.ceil(MoveX / this.Percentage); var MoveY = Math.abs(FloatingObjTop - DocTop); MoveY = Math.ceil(MoveY / this.Percentage); if (FloatingObjLeft < DocLeft) { this.FloatingObj.style.left = FloatingObjLeft + MoveX + "px"; } else { this.FloatingObj.style.left = FloatingObjLeft - MoveX + "px"; } if (FloatingObjTop < DocTop) { this.FloatingObj.style.top = FloatingObjTop + MoveY + "px"; } else { this.FloatingObj.style.top = FloatingObjTop - MoveY + "px"; } window.clearTimeout(this.setTimeOut); this.setTimeOut = window.setTimeout(function () { This.Run(); },this.setTime); }