PageSourceSearch

https://school.jma.or.jp/assets/js/common.js?1761559386

js jma.or.jp collected 2026-09-24 08:50:35 UTC 9,655 bytes, 333 lines download raw bytes

1$(function(){
2	navh = 0;
3	$('a[href*=\\#]:not([href=\\#],.page-seminar-achor)').on('click.link_in_page',function() {
4	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
5			var $target = $(this.hash);
6			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
7			if ($target.length) {
8				if($(this).parents('.menuBox').length){
9					setTimeout(function(){
10						var targetOffset = $target.offset().top - $('#gHeader').innerHeight();
11						$('html,body').animate({scrollTop: targetOffset}, 1000);
12					},100);
13				} else if ($(this).parents('.page-products-detail').length){
14					setTimeout(function(){
15						if (window.innerWidth >= 961) {
16							navh = $('.page-title').innerHeight();
17						}
18						var targetOffset = $target.offset().top - $('#gHeader').innerHeight() - navh;
19						$('html,body').animate({scrollTop: targetOffset}, 1000);
20					},100);
21				}else{
22					var targetOffset = $target.offset().top - $('#gHeader').innerHeight();
23					$('html,body').animate({scrollTop: targetOffset}, 1000);
24				}
25				return false;
26			}
27		}
28	});
29
30	var state = false;
31	var scrollpos;
32
33	$('.menu').on('click', function(){
34		if(state == false) {
35			scrollpos = $(window).scrollTop();
36			$('body').addClass('fixed').css({'top': -scrollpos});
37			$(this).addClass('on');
38			$('.menuBox').stop().fadeToggle();
39			state = true;
40		}else{
41			$('body').removeClass('fixed').css({'top': 0});
42			window.scrollTo( 0 , scrollpos );
43			$(this).removeClass('on');
44			$('.menuBox').stop().fadeToggle();
45			state = false;
46		}
47		return false;
48	});
49
50	if($('.popBtn').length){
51		var popscrollpos;
52		$('.popBtn').magnificPopup({
53			midClick: true,
54			mainClass: 'mfp-fade mfp-type',
55			removalDelay: 400,
56			showCloseBtn: false,
57			callbacks: {
58				open: function() {
59					popscrollpos = $(window).scrollTop();
60					$('body').addClass('fixed').css({'top': -popscrollpos});
61				},
62				close: function(){
63					$('body').removeClass('fixed').css({'top': 0});
64					window.scrollTo( 0 , popscrollpos );
65					$('body').removeClass('fixed');
66				},
67				beforeClose: function() {
68					if($('#popTable.zoomout').length){
69						$('#popTable').removeClass('zoomout');
70						$('.amplifyBtn').show();
71					}
72				},
73			}
74		});
75		$('.closeBtn,.comClose').click(function (e) {
76			$.magnificPopup.close();
77			return false;
78		});
79	}
80
81	var pcflag,spflag;
82	if(window.innerWidth > 960){
83		pcflag = 1;
84		spflag = 0;
85	}else{
86		pcflag = 0;
87		spflag = 1;
88	}
89
90	$(window).resize(function(){
91		if(window.innerWidth <= 960){
92			if(pcflag){
93				setTimeout(function(){window.location.reload()},100);
94				pcflag = 0;
95				spflag = 1;
96			}
97		}else{
98			if(spflag){
99				setTimeout(function(){window.location.reload()},100);
100				pcflag = 1;
101				spflag = 0;
102			}
103		}
104	});
105
106	// マイページリンク
107	$('.js-mypage-pane').click(function() {
108		$mypagePane = $(this);
109		if ($('.mypage-pane__list').is(':visible')) {
110			$('.mypage-pane__list').slideToggle(function() {
111				$mypagePane.toggleClass('is-active');
112			});
113		} else {
114			$mypagePane.toggleClass('is-active');
115			$('.mypage-pane__list').slideToggle();
116		}
117	});
118
119	// メニュートグル(SP)
120	$('.js-toggle-menu').click(function() {
121		$(this).toggleClass('is-active');
122		$(this).next().slideToggle();
123	});
124
125	// スクロール
126	$('li[id^="scroll_"]').click(function(){
127		var keyname = $(this).attr('id').slice(7);
128		// 商品詳細ページのSP時、遷移先が非表示となっている場合は、もっと見るボタンを非表示化、記事を全表示)
129		if ($('.page-products-detail').length > 0 && window.innerWidth <= 768) {
130			if ($("#article_"+keyname).is(':hidden')) {
131				$('.article').show();
132				$('.c-btn--more').remove();
133			}
134		}
135		var article_offset = $("#article_"+keyname).offset();
136		var article_top = article_offset.top;
137        article_top = calcScrollTop(article_top);
138        if (keyname === '90') {
139            // 開催日程の場合の調整
140            article_top -= 44;
141        }
142		$('html,body').animate({scrollTop:article_top}, 800);
143		return false;
144	});
145
146	// ページトップへ戻るボタンスクロール
147	$('.page-top_btn').click(function(){
148		var ptop_offset = $("body").offset();
149		var ptop_scr = ptop_offset.top;
150		$('html,body').animate({scrollTop:ptop_scr}, 800);
151		return false;
152	});
153
154	// 商品詳細ページ
155	if ($('.page-products-detail').length > 0) {
156		$('.preview-red-btn').click(function() {
157			// ステータスプレビュー
158			$('.status-preview__main').toggleClass('status-preview-display--none')
159			// ステータスプレビューリスト
160			$('.status-preview-session').toggleClass('status-preview-session--none')
161		});
162
163		$('.session_code_list .tabGroup div').on('click', function(){
164			if ($(this).hasClass('active')) return;
165			var day = $(this).attr('class');
166			$('.tabGroup div.active').removeClass('active');
167			$('.tabGroup div.'+day).addClass('active');
168			$('.sessionCodeBox div').hide();
169			$('.sessionCodeBox div.'+day).fadeIn();
170		});
171
172		$('.deluser').click(function(){
173			var delete_num = $(this).attr('href').slice(1);
174			$('input[name="delete_num"]').val(delete_num);
175			$('#form1').append('<input type="hidden" name="mode" value="deluser" />');
176			$('#form1').submit();
177			return false;
178		});
179
180		if (window.innerWidth <= 960) {
181			// SP時は、記事を一つのみ表示する
182			$('.article:not(:eq(0))').hide();
183		} else {
184			// PC時は、もっと見るボタンを非表示にする
185			$('.c-btn--more').remove();
186		}
187
188		// PC時に、記事を全て表示する
189		$(window).on('resize', function() {
190			if (window.innerWidth > 961) {
191				$('.article').show();
192				$('.c-btn--more').remove();
193			}
194		});
195
196		$('.c-btn--more').click(function() {
197			$(this).remove();
198			$('.article').show();
199		});
200
201		$('.c-btn--entry-notice').click(function() {
202			$(this).remove();
203			$('.entry-notice__inner').show();
204		});
205	}
206
207	// セッション一覧テーブル
208	if ($('.c-session-table').length > 0) {
209		$(".show-finished-seminar__link").on("click", function() {
210			$(".finished-seminar").slideToggle();
211			$(this).toggleClass("is-active");
212		});
213	}
214
215	// 体系図ページ
216	if ($('.page-chart').length > 0) {
217		$('.tab_panel .tab_box').hide();
218		//if ($('.page-chart--development').length == 0) {
219			if ($('.tab_panel').hasClass('tab_panel01')) {
220				$('.tab_panel01 .tab_box').eq(0).show();
221			} else {
222				$('.tab_panel .tab_box').eq(-1).show();
223			}
224			$('.tab_panel02 .tab_box').eq(0).show();
225		//}
226
227		$('.tab_panel .tab_ul li a').click(function() {
228			var ind=$(this).parent('li').index();
229			$(this).parent('li').addClass('on').siblings().removeClass('on');
230			$('.tab_box').hide();
231			$('.tab_box:eq('+ind+')').show();
232			return false;
233		});
234		$('.tab_panel02 .tab_ulnew li a').click(function() {
235			var ind=$(this).parent('li').index();
236					console.log(ind);
237			$(this).parent('li').addClass('on').siblings().removeClass('on');
238			$('.tab_box').hide();
239			$('.tab_panel02 .tab_box:eq('+ind+')').show();
240			return false;
241		});
242	}
243});
244
245$(window).on('load',function(){
246	var localLink = window.location+'';
247	if(localLink.indexOf("#") != -1 && localLink.slice(-1) != '#'){
248		localLink = localLink.slice(localLink.indexOf("#")+1);
249		if($('#'+localLink).length){
250			navh = window.innerWidth >= 961 ? $('.page-title').innerHeight() : 0;
251			setTimeout(function(){
252				$('html,body').animate({scrollTop: $('#'+localLink).offset().top - $('#gHeader').innerHeight() - navh}, 500);
253			},100);
254		}
255	}
256});
257
258
259function calcScrollTop(height) {
260    if ($('.cf-area').length > 0) {
261        // cf ログイン中
262        if (window.innerWidth <= 960) {
263            height -= 160;
264        } else {
265            height -= 145;
266        }
267    } else {
268        // cf 非ログイン
269        if (window.innerWidth <= 960) {
270            height -= 85;
271        } else {
272            height -= 105;
273        }
274    }
275    return height;
276}
277$(function () {
278	$('.c-pwd').each(function () {
279		var that = $(this);
280		$(this).find('.c-pwd-btn').on('click', function () {
281			$(this).toggleClass('on');
282			if ($(this).hasClass('on')) {
283				that.find('.c-input-pwd').attr('type', 'text');
284			} else {
285				that.find('.c-input-pwd').attr('type', 'password');
286			}
287		});
288	});
289
290	$('.c-js-check .c-checkbox input').on('change', function () {
291		console.log(0);
292		if ($(this).prop('checked')) {
293			$(this).parents('.c-js-check').addClass('active');
294		} else {
295			$(this).parents('.c-js-check').removeClass('active');
296		}
297	}).trigger('change');
298
299	if ($('.simpleBar').length) {
300		new SimpleBar($('.simpleBar')[0], { autoHide: false });
301	}
302
303	$('.application .person h4.h4Ttl01.more .accordionBtn:not(.jsNot)').on('click', function () {
304		$(this).toggleClass('on');
305		$(this).parents('h4.h4Ttl01').next().stop().slideToggle();
306		return false;
307	});
308
309	if ($('.datepicker').length) {
310		$('.datepicker').datepicker({
311			showOn: 'focus',
312			dateFormat: 'yy/mm/dd',
313			changeMonth: true,
314			changeYear: true,
315			yearRange: '2015:2030',
316			showMonthAfterYear: true,
317			yearSuffix: '',
318			monthNames: ['1','2','3','4','5','6','7','8','9','10','11','12'],
319			monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
320			showButtonPanel: true,
321			beforeShow: function(input)
322			{
323				calObj = input;
324	
325				setTimeout(function()
326				{
327					addButtonToDatePicker();
328				}, 1 );
329			}
330		});
331	}
332})
333

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.