function main_lnb_fix(){ var position = $(window).scrollTop(); if(position > 80){ $(".jbMenu").addClass("jbFixed"); } else if(position < 80){ $(".jbMenu").removeClass("jbFixed"); } if(position > 60){ $("#mobile_header").addClass("jbmFixed"); }else if(position < 60){ $("#mobile_header").removeClass("jbmFixed"); } } $(document).ready(function() { main_lnb_fix(); }); $(window).scroll(function() { main_lnb_fix(); }); $('.sub_location ul li span').click(function(){ $(this).next('ul').slideToggle('fast'); $(this).parents('ul').toggleClass('on'); }); $('.sub_location ul').mouseleave(function(){ $(this).find('ul').slideUp('fast'); $(this).removeClass('on'); }); $(".subnav1>li>div").click(function() { $(".subnav").addClass("on"); if($(this).next("ul").length){ $(this).next("ul").removeClass("on"); } $(".subnav.on").slideUp(); if($(this).next("ul").length){ $(this).next().slideToggle("slow"); return false; } }); $("#back_cover").css("height",($('body').prop("scrollHeight"))); $("#sideMenu").css("height",($('body').prop("scrollHeight"))); $("#sideMenu").blur(function(){ $("#sideMenu").stop().animate({'left':'-250px'},500); }); $("#back_cover").click(function () { $('#sideMenu').stop().animate({'left':'-250px'},500); $(this).hide(); }); $(".qbt").click(function () { var rq = $("#sideMenu").css("right"); if(rq == "-250px"){ $("#back_cover").show(); $('#sideMenu').stop().animate({'right':'0'},500); }else{ $("#back_cover").hide(); $('#sideMenu').stop().animate({'right':'-250px'},500); } }); $(window).scroll(function(){ if($(this).scrollTop() != 0){$('#backtotop').fadeIn();}else{$('#backtotop').fadeOut(); }});$('#backtotop').click(function() {$('body,html').animate({scrollTop:0},800);});$('div.select_bo_cate a.sel').click(function () {if($(this).siblings('ul').css("display") == "none"){$(this).siblings('ul').animate({"height":"show"},300);} else {$(this).siblings('ul').animate({"height":"hide"},300);}});function getCookie(e){e+="=";var n=document.cookie,i=n.indexOf(e),t="";if(-1!=i){i+=e.length;var o=n.indexOf(";",i);-1==o&&(o=n.length),t=n.substring(i,o)}return unescape(t)}$("#favorite").click(function(){var i=window.location.href,r=document.title,a=!1;if(window.sidebar&&window.sidebar.addPanel)window.sidebar.addPanel(r,i,"");else if(window.sidebar&&-1"+dtls()+"");}function setCookie(e,o,t){var i=new Date;i.setDate(i.getDate()+t),cookies=e+"="+escape(o)+"; path=/ ",void 0!==t&&(cookies+=";expires="+i.toGMTString()+";"),document.cookie=cookies} if(dt_val == ""){setCookie('dt','dt',7300);}function scrollToBottom(){$("html, body").animate({scrollTop:$(document).height()},"slow")}function scrollToTop(){$("html, body").animate({scrollTop:0},"slow")}$(".plist img").hover(function() {$(this).next().fadeIn(500);});$(".plist").mouseleave(function() {$(".pi_u").fadeOut(500);}); /* side bar */ $('.right-wing .top').on('click', function() { $('#fixedBanner2').addClass('on'); $('.right-wing').addClass('off'); }); $('.fixedToggleQuick').on('click', function() { $('#fixedBanner2').removeClass('on'); $('.right-wing').removeClass('off'); }); $('.bottom .up').on('click', function() { $('html').animate({scrollTop:0}, 600); }); $('.bottom .down').on('click', function() { $('html').animate({scrollTop:$(document).height()}, 600); }); var lb_btn = { init : function(){ if($('.lb-btn').length > 0){ this.action(); } }, action : function(){ var spd = 500; $(document).on('click','.lb-btn',function(){ var href = $(this).attr('href'); var idx = $(this).data('idx'); var type = $(this).data('type'); if(type == undefined){ type = 'GET'; } $.ajax({ type: type, url: href, data : idx, success : function(data) { $('body').find('.lb_container').remove().end().append(data).find('.lb_container').fadeIn(spd); } }); return false; }); $(document).on('click','.lb_container ._bg, .lb_container ._close',function(){ $('.lb_container').fadeOut(spd,function(){$(this).remove()}); return false; }); } } $(document).ready(function(){ lb_btn.init(); }); var lastScrollTop = 0; var ww = $( window ).width(); $(document).ready(function() { if(parseInt(ww,10) <= 480) { setTimeout(function() { $('.right-wing').addClass('off'); }, 500); } $(window).scroll(function(event) { var st = $(this).scrollTop(); if(parseInt(ww,10) <= 480) { if (st > lastScrollTop){ $('.right-wing').addClass('off'); } else if(st < lastScrollTop) { $('.right-wing').removeClass('off'); } } lastScrollTop = st; }); });