PageSourceSearch

https://www.ranking-helmet.com/assets/static/site/np_template/js/menuH.js

js ranking-helmet.com collected 2026-10-06 04:19:11 UTC 4,660 bytes, 126 lines download raw bytes

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

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.