PageSourceSearch

https://total-hoken.com/js/public/scrollmenu.js?1559176284

js total-hoken.com collected 2026-10-06 08:53:36 UTC 9,772 bytes, 308 lines download raw bytes

1!function ($) {
2
3
4	//ファイル読み込んだ時に対象メニューをクローンさせるところまで
5	var $win           = $(window);
6	//var $sc_menu       = '';
7	var $targetMenu = '';
8	//var $clone_sc_menu = '';
9	var $cloneTargetMenu = '';
10	var headerMenuFlg    = false;
11	var $fixedMenu     = '';
12	var hmpScFlg      = 0;
13	var hmpFlg        = 0;
14	var $heightDiv = '';
15	var $bg           = $('#bg');
16	var device        = $bg.data('device');
17
18	setTimeout(function(){
19		$.marquee_init($('#header.normal-header'));
20	},1000);
21
22	//スクロール時メニュー動作 
23	//$hmpScFlg 0.しない,1.スクロール時メニュー,2.通常メニュー
24	//$hmpFlg 0.メニューパーツ,1.ヘッダー内メニュー
25	if($('.parts-area').data('area') == 'header'){
26		hmpScFlg = $('.parts-area').data('hmp-sc-flg');
27		hmpFlg   = $('.parts-area').data('hmp-flg');
28	}
29
30	//スクロール時メニュー表示
31	if(hmpScFlg == 1){
32		//spページで通常ヘッダー(メニューパーツ含む)使用
33		if($('header').hasClass('pos3') || $('header').hasClass('pos5')){
34			if($('#parts5').length){
35				$targetMenu  = $('#parts5.menu-parts');
36				headerMenuFlg = true;
37			}
38		//spページで通常ヘッダーのみ使用
39		}else if($('header').hasClass('pos4')){
40			if($('#parts1').find('.menu-parts').length){
41				$targetMenu  = $('#parts1').find('.menu-parts');
42				headerMenuFlg = true;
43			}
44		//通常ページ
45		}else{
46			//ヘッダー内メニュー
47			if(hmpFlg){
48				if($('#parts1').find('.menu-parts').length){
49					$targetMenu  = $('#parts1').find('.menu-parts');
50					headerMenuFlg = true;
51				}
52			//パーツメニュー
53			}else{
54				if($('#parts5').length){
55					$targetMenu  = $('#parts5.menu-parts');
56					headerMenuFlg = true;
57				}
58			}
59		}
60		
61		//ヘッダータグの外にスクロールメニュー複製(パララックスでうまく動かないなど懸念、構成的に)
62		if($targetMenu.length){
63			$cloneTargetMenu = $targetMenu.clone(true).insertAfter($('header')).attr('id','hd-sc-menu').css('display','none');
64			//#4083 matuuchi
65			if($cloneTargetMenu.find(".marquee-menu").length){
66				
67				$cloneTargetMenu.find('nav > ul').removeClass('marquee-menu');
68				$cloneTargetMenu.find('nav > ul > li > ul.current').addClass('marquee-menu');
69
70			}
71		}
72
73	//通常メニュー表示
74	}else if(hmpScFlg == 2){
75		//spページで通常ヘッダー(メニューパーツ含む)使用
76		if($('header').hasClass('pos3') || $('header').hasClass('pos5')){
77			if($('header').find('.menu-parts').length){
78				$targetMenu  = $('#parts5.menu-parts');
79			}
80		//spページで通常ヘッダーのみ使用
81		}else if($('header').hasClass('pos4')){
82			if($('#parts1').find('.menu-parts').length){
83				$targetMenu  = $('#parts1');
84			}
85		//通常ページ
86		}else{
87			//ヘッダー内メニュー
88			if(hmpFlg){
89				if($('#parts1').find('.menu-parts').length){
90					$targetMenu  = $('#parts1');
91				}
92			//パーツメニュー
93			}else{
94				if($('#parts5').length){
95					$targetMenu  = $('#parts5.menu-parts');
96				}
97			}
98		}
99
100		//パララックスでなければ高さをとるためのdivを作成
101		if (!(real_device == 'pc' && device == 'pc' && $bg.data('sp-type') == 1 && !BaseUrl.match(/(dsadmin)/) && !$bg.data('capture'))) {
102			if ($targetMenu) {
103				$heightDiv = $('<div id="height-div"></div>').insertAfter($targetMenu).css('height',$targetMenu.height());
104				$heightDiv.css('display','none');
105			}
106		}
107	}
108	
109
110	$.extend({
111		scroll_section_init: function() {
112			if($targetMenu && $targetMenu.length){
113				var menu_posX = $targetMenu.offset().top + $targetMenu.height();
114				var menu_posY = $targetMenu.offset().left;
115
116				// スクロールでもメニューついてくる
117				$win.on('load scroll', function() {
118					var value = $(this).scrollTop();
119
120					if (BaseUrl.match(/(dsadmin\/SpPages)/)) {
121						value = value + 56;
122					}
123
124					if (($cloneTargetMenu.length && ($cloneTargetMenu.css('display') == 'none') && (hmpScFlg == 1)) || hmpScFlg == 2) {
125
126						if (value > menu_posX) {
127							//開くアニメーション
128							if(hmpScFlg == 1){
129								$.visible_hdmenu();
130							}else{
131								$.visible_normal_hdmenu();
132							}
133						}else if (value < menu_posX && hmpScFlg == 2) {
134							//閉じるアニメーション
135							$.hidden_normal_hdmenu();
136						}
137					}else{
138						if (value < menu_posX ) {
139
140							//閉じるアニメーション
141							$.hidden_hdmenu();
142						}
143					}
144				});
145
146			}
147		//開くアニメーション(スクロールメニュー)
148		},visible_hdmenu: function() {
149
150			if(!$cloneTargetMenu.length) return;
151
152			if (!$cloneTargetMenu.hasClass('is-fixed')) {
153
154				//スクロールメニュー表示の場合
155				if($cloneTargetMenu.length && (hmpScFlg == 1)){
156
157					$cloneTargetMenu.find('.menu-bottom').remove();
158
159					if(headerMenuFlg){
160						//スタイルがあたらないので一旦すべて削除
161						$cloneTargetMenu.removeAttr('style');
162						$cloneTargetMenu.css('display','none');
163					}
164				}
165
166				$cloneTargetMenu.addClass('is-fixed').hide();
167
168				setTimeout(function() {
169
170					$cloneTargetMenu.find('.logo').css('display','block');
171					$cloneTargetMenu.animate({height: 'show'}, 'slow');
172
173					$cloneTargetMenu.find('nav').find('li').find('a').attr('id','');
174
175					/*$firstLi = $cloneTargetMenu.find('.nav > li');
176
177					console.log($firstLi.length);
178					$firstLiWidth = $firstLi.width();
179					console.log($firstLiWidth);
180					$firstLi.css('width',$firstLiWidth);*/
181					
182
183
184					//サブメニュー表示時一階層目が伸びるの防止
185					$cloneTargetMenu.find('.nav > li').each(function(){
186						$(this).css('width',$(this).innerWidth() + 1);
187					});
188					
189
190					$cloneTargetMenu.find('nav').addClass('normal-menu');
191
192					//メニュー 垂直対応
193					if($cloneTargetMenu.find(".logo").length && $cloneTargetMenu.find('nav.normal-menu').length){
194						var padding = ($cloneTargetMenu.find(".logo").height() / 2) - ($cloneTargetMenu.find('nav.normal-menu').height() / 2);
195						$cloneTargetMenu.find('nav.normal-menu').css("padding-top",padding+"px");
196					}
197					
198
199					//$cloneTargetMenu.find('a').removeAttr('style');
200					//$cloneTargetMenu.find('span').removeAttr('style');
201
202					//パララックス
203					if (real_device == 'pc' && device == 'pc' && $bg.data('sp-type') == 1 && !BaseUrl.match(/(dsadmin)/) && !$bg.data('capture')) {
204						$("#header").animate({height: 'hide'}, 'slow');
205					}
206
207					$.marquee_init($('#hd-sc-menu'));
208				}, 50);
209			}
210		//閉じるアニメーション(スクロールメニュー)
211		},hidden_hdmenu: function() {
212			if(!$cloneTargetMenu.length) return;
213
214			if ($cloneTargetMenu.hasClass('is-fixed')) {
215				$cloneTargetMenu.animate({height: 'hide'}, 'slow');
216
217				setTimeout(function() {
218					$cloneTargetMenu.removeClass('is-fixed').css('display','none');
219					$cloneTargetMenu.find('.logo').css('display','none');
220				}, 500);
221
222				//パララックス
223				if (real_device == 'pc' && device == 'pc' && $bg.data('sp-type') == 1 && !BaseUrl.match(/(dsadmin)/) && !$bg.data('capture')) {
224					$("#header").animate({height: 'show'}, 'slow');
225				}
226			}
227		},visible_normal_hdmenu:function(){
228
229			if($targetMenu.length){
230
231				//パララックス
232				if (real_device == 'pc' && device == 'pc' && $bg.data('sp-type') == 1 && !BaseUrl.match(/(dsadmin)/) && !$bg.data('capture')) {
233					$("#parts1").animate({height: 'hide'}, 'slow');
234				}else{
235					$targetMenu.css('position','fixed');
236					if($heightDiv.length){
237						$heightDiv.css('display','block');
238					}
239				}
240
241				var targetTop = 0;
242				var targetLeft = 0;
243
244				if(BaseUrl.match(/(dsadmin)/) && $("#ad-preview").length){
245
246					targetTop = parseInt($("#ad-preview").css("padding-top"),10);
247					targetLeft = parseInt($("#ad-preview").css("padding-left"),10) / 2;;
248					
249					if(!targetTop) targetTop = ($("#ad-preview").css("margin-top")) ? parseInt($("#ad-preview").css("margin-top"),10) : 0;
250					if(!targetLeft) targetLeft = ($("#ad-preview").css("margin-left")) ? parseInt($("#ad-preview").css("margin-left"),10) / 2 : 0;
251					
252					/*
253					var attr = $bg.attr("data-sp-type");
254					if( typeof attr !== 'undefined' && attr !== false ){
255						targetLeft = targetLeft / 2;
256					}
257					*/
258				}
259
260				$targetMenu.css('top',targetTop);
261				$targetMenu.css('left',targetLeft);
262				$targetMenu.css('z-index','10');
263				$targetMenu.css('width','100%');
264
265				$targetMenu.closest("#header").addClass("normal-hdmenu");
266				
267				//サブメニュー表示時一階層目が伸びるの防止
268				if($cloneTargetMenu.length){
269					$cloneTargetMenu.find('.nav > li').each(function(){
270						$(this).css('width',$(this).innerWidth() + 1);
271					});
272				}
273
274				$.marquee_init($('#hd-sc-menu'));
275			}
276
277		},hidden_normal_hdmenu:function(){
278
279			if($targetMenu.length){
280				$targetMenu.closest("#header").removeClass("normal-hdmenu");
281
282
283				$targetMenu.css('position','');
284				if(BaseUrl.match(/(dsadmin)/) && $("#ad-preview").length){
285					$targetMenu.css('top','0');
286					$targetMenu.css('left','0');
287
288				}
289
290				//パララックス
291				if (real_device == 'pc' && device == 'pc' && $bg.data('sp-type') == 1 && !BaseUrl.match(/(dsadmin)/) && !$bg.data('capture')) {
292					$("#parts1").animate({height: 'show'}, 'slow');
293				}else{
294					if($heightDiv.length){
295						$heightDiv.css('display','none');
296					}
297				}
298
299			}
300
301		}
302	});
303
304	if(!(real_device == 'pc' && device == 'pc' && $bg.data('sp-type') == 1 && !BaseUrl.match(/(dsadmin)/) && !$bg.data('capture'))){
305		$.scroll_section_init();
306	}
307
308}($);

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.