1$(document).ready(function(){ 2 if($(window).width() > 1119){ 3 gnbHover() 4 depthHeight() 5 } else { 6 gnbSet(); 7 gnbAct(); 8 gnbOpen(); 9 gnbClose() 10 } 11 12 $(window).resize(function(){ 13 if($(window).width() > 1119){ 14 depthHeight() 15 } else { 16 gnbSet(); 17 gnbAct(); 18 gnbOpen(); 19 gnbClose() 20 } 21 }) 22}) 23 24function maxHeightDepth(){ 25 let heightArray = $('.gnb .depth02').map(function () { 26 return $(this).outerHeight(); 27 }).get(); 28 29 let max_width = Math.max.apply(Math, heightArray); 30 31 return max_width; 32} 33 34function gnbHover(){ 35 $('.gnb').hover(function(){ 36 if($('.gnb').find('.bg').length == 0){ 37 $('.gnb').append('<div class="bg"></div>'); 38 39 $('.gnb .bg').height(maxHeightDepth()) 40 } 41 }, function(){ 42 $('.gnb .bg').remove() 43 }) 44} 45 46function depthHeight(){ 47 let postion1= $('.gnb .depth01 > li').eq(0).offset().left + $('.gnb .depth01 > li').eq(0).width(); 48 let postion2 = $('.gnb .depth01 > li').eq(1).offset().left 49 50 $('.gnb .depth02').css('width', 'calc(100% + ' + (postion2 - postion1) + 'px)') 51} 52 53function gnbAct(){ 54 $('.gnb .depth01 > li > a').click(function(){ 55 $('.gnb .depth01 > li').not($(this).closest('li')).removeClass('active') 56 $(this).closest('li').toggleClass('active'); 57 $(this).closest('li').find('.active').removeClass('active'); 58 }) 59 60 $('.gnb .depth02 > ul > li > a').click(function(e){ 61 if($(this).closest('li').hasClass('has-depth')){ 62 e.preventDefault(); 63 64 $(this).closest('li').toggleClass('active') 65 } 66 }); 67 68 69 70} 71 72function gnbSet(){ 73 $('.gnb .depth02 > ul > li').each(function(){ 74 if($(this).find('.depth03').length > 0){ 75 $(this).addClass('has-depth'); 76 } 77 }); 78} 79 80function gnbOpen(){ 81 $('#header .btn-menu').click(function(){ 82 dimMaker() 83 84 $('.navigation').addClass('active') 85 }) 86} 87 88function gnbClose(){ 89 $('#header .btn-close').click(function(){ 90 dimRemove() 91 92 $('.navigation').removeClass('active') 93 }); 94 95 $('html, body').click(function(e){ 96 // ëìì¸ í´ë¦ì 97 if( !$('.navigation').is(e.target) && $('.navigation').has(e.target).length === 0 98 && !$('#header .btn-menu').is(e.target) && $('#header .btn-menu').has(e.target).length === 0 ){ 99 dimRemove(); 100 101 $('.navigation').removeClass('active') 102 } 103 }) 104} 105 106// dim ìì± 107function dimMaker() { 108 if($('body').find('.dim').length > 0){ 109 return; 110 } 111 $('body').append('<div class="dim"></div>'); 112 bodyHidden(); 113} 114 115// dim ì ê±° 116function dimRemove() { 117 $('.dim').remove(); 118 bodyAuto(); 119} 120 121// body scroll hidden 122function bodyHidden() { 123 $('body').css('overflow', 'hidden'); 124} 125 126// body scroll auto 127function bodyAuto() { 128 $('body').css('overflow', '') 129} 130
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.