PageSourceSearch

https://www.mcvb.jp/lib/js/script.js

js mcvb.jp collected 2026-10-02 19:09:00 UTC 3,589 bytes, 151 lines download raw bytes

1/* ===================================================================
2
3 * PC向けメニュー
4
5=================================================================== */
6$(function($) {
7	// 読み込み時処理
8	navFix();
9	// スクロール時処理
10	$(window).on('scroll', function() {
11		navFix();
12	});
13
14	// ナビゲーション固定
15	function navFix() {
16		var headerH = $('#sub_image').outerHeight(true);
17		if ($(this).scrollTop() > headerH) {
18			$('nav').addClass('fixed');
19		} else {
20			$('nav').removeClass('fixed');
21		}
22	}
23});
24
25
26/* ===================================================================
27
28 * PC/スマホ向けメニュー切り替え
29
30=================================================================== */
31$(function($){
32	var timer = false;
33	var windowWidth = window.innerWidth || document.documentElement.clientWidth || 0;
34	var nowWidth;
35
36	// 読み込み時処理
37	$(window).on('load', function(){
38		headerHight();
39		spMenu();
40		subNav();
41		summay();
42	});
43
44	// リサイズ時処理
45	$(window).on('resize', function(){
46		if (timer !== false) {
47			clearTimeout(timer);
48		}
49		timer = setTimeout(function() {
50			nowWidth = window.innerWidth || document.documentElement.clientWidth || 0;
51			if ( windowWidth != nowWidth ) {
52				headerHight();
53				subNav();
54				summay();
55				windowWidth = window.innerWidth || document.documentElement.clientWidth || 0;
56			}
57		}, 200);
58	});
59
60	// ヘッダー分の余白取得(スマートフォンのみ)
61	function headerHight() {
62		if ($('#spMenu').css('display') == 'block') {
63			var headerH = $('header').outerHeight(true);
64			$('body').css({'margin-top' : headerH});
65		}else {
66			$('body').css({'margin-top' : 0});
67		}
68	}
69
70	// メニューボタンの表示(
71	function spMenu() {
72		$('#spMenu').on('click', function(e) {
73			$('.gnav').slideToggle(e);
74			$('#navBtnIcon').toggleClass('close');
75			$('html, body').toggleClass('lock');
76		});
77	}
78
79	// サブメニューの表示
80	function subNav() {
81		if ($('#spMenu').css('display') == 'block') {
82			$('.subnav > a').off().on('click', function(e) {
83				e.preventDefault();
84				$(this).next('ul').slideToggle();
85				$(this).parent().toggleClass('active');
86			});
87		} else {
88			if('ontouchstart' in document) {
89				$('.subnav > a').off().on('click', function(e) {
90					e.preventDefault();
91				});
92			}
93		}
94	}
95
96	// 要約部分の非表示
97	function summay() {
98		if ($('#spMenu').css('display') == 'block') {
99			var position = 50; // 非表示位置
100			var $element = $('.summary');
101			if ($(window).scrollTop() > position){
102				$element.hide();
103			}
104			$(window).on('scroll', function(){
105				if ($(this).scrollTop() >= position) {
106					$element.not(':animated').hide();
107				} else {
108					$element.not(':animated').show();
109				}
110				headerHight();
111			});
112		}
113	}
114});
115
116/* ===================================================================
117
118 * ページ内リンク
119
120=================================================================== */
121$(function($){
122	var timer = false;
123	$(window).on('load', function(){
124		if (timer !== false) {
125			clearTimeout(timer);
126		}
127		timer = setTimeout(function() {
128			innerLink();
129			innerLinkMenu();
130		}, 300);
131	});
132
133
134
135	function innerLinkMenu() {
136		// メニューの表示・非表示
137		$('.gnav a[href^="#"]').on('click', function(e) {
138			if($('#spMenu').css('display') == 'block') {
139				$('.gnav').slideToggle(e);
140				$('#navBtnIcon').toggleClass('close');
141				$('html, body').toggleClass('lock');
142			}
143		});
144	}
145});
146
147$(document).ready(function(){
148  $('#sub_image h1').css('visibility','hidden');
149     $('#sub_image h1').addClass("titAnime");
150    
151});

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.