1(function () { 2 var clickYN1 = false; 3 if (!window.menuNH) { 4 window.menuNH = {}; 5 }; 6 window.menuNH = { 7 menuNH_pc: function () { 8 var curNHIdx; 9 $('.w-com-menuNH').each(function (index, element) { 10 var menuThis = $(this); 11 if (menuThis.hasClass('w-com-menuNH5')) { 12 return ''; 13 } 14 menuThis.find('.ul-parent >li').each(function(index, element) { 15 if($(this).hasClass('cur')){ 16 curNHIdx=index; 17 } 18 }); 19 menuThis.find('.ul-parent >li').hover(function(){ 20 $(this).siblings('li').removeClass('cur'); 21 },function(){ 22 menuThis.find('.ul-parent >li').eq(curNHIdx).addClass('cur'); 23 }); 24 }) 25 $('.w-com-menuNHEW').each(function(index, element) { 26 var $liF=$(this).find('.ul-parent').children('li'); 27 var liLen=$liF.length; 28 $liF.css({'min-width':(1.0/liLen) * 100 +'%'}); 29 }); 30 $('.w-com-menuNH li').hover(function(){ 31 var $conSubMenu=$(this).children('.ul-submenu'); 32 $conSubMenu.show(); 33 var wid_parent=$conSubMenu.parent().width(); 34 var wid_parent_left=$(this).offset().left; 35 var window_w=$(window).width(); 36 var wid=0; 37 var $conSubMenuli=$conSubMenu.children('ul').children('li'); 38 for(var j=0; j<$conSubMenuli.length;j++){ 39 var li_width=$conSubMenuli.eq(j)[0].getBoundingClientRect().width; 40 wid=wid+li_width; 41 } 42 if (wid > window_w) { 43 $conSubMenu.css({ 'width': window_w, 'left': -wid_parent_left }); 44 } else { 45 if (wid_parent_left > (wid - wid_parent) / 2) { 46 if ((window_w - wid_parent_left) > (wid + wid_parent) / 2) { 47 $conSubMenu.css({ 'width': wid + 1, 'left': -(wid - wid_parent) / 2 }); 48 } else { 49 $conSubMenu.css({ 'width': wid + 1, 'right': -(window_w - wid_parent_left - wid_parent) }); 50 } 51 } else { 52 $conSubMenu.css({ 'width': wid + 1, 'left': -wid_parent_left }); 53 } 54 } 55 },function(){ 56 $(this).children('.ul-submenu').removeAttr("style"); 57 }); 58 }, 59 menuNH_tel: function () { 60 $('.w-com-menuNH .systitle').unbind('click'); 61 $('.w-com-menuNH .systitle').bind('click',function(){ 62 if($(this).hasClass('open')){ 63 $(this).removeClass('open'); 64 $(this).siblings('.ul-parent').slideUp(); 65 $(this).siblings('.ul-parent').find('.ul-submenu').slideUp(); 66 $(this).siblings('.ul-parent').find('.open').removeClass('open'); 67 }else{ 68 $(this).addClass('open'); 69 $(this).siblings('.ul-parent').slideDown(); 70 } 71 return false; 72 }); 73 if(clickYN1){$('.w-com-menuNH .fa-plus').unbind('click');} 74 $('.w-com-menuNH .fa-plus').click(function(){ 75 $(this).parent().parent().siblings('li').find('.ul-submenu').slideUp(); 76 $(this).parent().parent().siblings('li').removeClass('open'); 77 $(this).parent().parent().siblings('li').find('.open').removeClass('open'); 78 if($(this).parent().siblings('.ul-submenu').is(':hidden')){ 79 $(this).parent().siblings('.ul-submenu').slideDown(); 80 $(this).parent().parent().addClass('open'); 81 }else{ 82 $(this).parent().siblings('.ul-submenu').slideUp(); 83 $(this).parent().siblings('.ul-submenu').find('.ul-submenu').slideUp(); 84 $(this).parent().parent().removeClass('open'); 85 $(this).parent().parent().find('.open').removeClass('open'); 86 } 87 return false; 88 }); 89 clickYN1=true; 90 } 91 } 92})(); 93$(function(){ 94 if($(window).width()>767){ 95 menuNH.menuNH_pc(); 96 }else{ 97 menuNH.menuNH_tel(); 98 } 99 var oldWidth=$(window).width(); 100 $(window).resize(function(){ 101 var newWidth=$(window).innerWidth(); 102 if(oldWidth>767){ 103 if (newWidth < 768) { 104 $('.w-com-menuNH .systitle').siblings('.ul-parent').slideUp(); 105 $('.w-com-menuNH .ul-submenu').removeAttr("style"); 106 $('.w-com-menuNH li').unbind('mouseenter').unbind('mouseleave'); 107 menuNH.menuNH_tel(); 108 } 109 }else{ 110 if (newWidth > 768) { 111 $('.w-com-menuNH .systitle').unbind('click'); 112 $('.w-com-menuNH .systitle').removeClass('open'); 113 $('.w-com-menuNH .systitle').siblings('.ul-parent').slideDown(); 114 $('.w-com-menuNH .systitle').siblings('.ul-parent').find('.ul-submenu').removeAttr('style'); 115 $('.w-com-menuNH .systitle').siblings('.ul-parent').find('.open').removeClass('open'); 116 $('.w-com-menuNH .ul-parent').removeAttr("style"); 117 $('.w-com-menuNH .ul-submenu').removeAttr("style"); 118 $('.w-com-menuNH .open').removeClass('open'); 119 menuNH.menuNH_pc(); 120 } 121 } 122 oldWidth=$(window).width(); 123 }); 124});
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.