PageSourceSearch

https://shiso.or.jp/wpapp/wp-content/themes/shiso2022ver2/js/common.js?202610042223

js shiso.or.jp collected 2026-10-04 13:23:15 UTC 11,428 bytes, 359 lines download raw bytes

1$(function () {
2
3	//スマホ 画像
4	// 置換の対象とするclass属性。
5	var $elem = $('.img_switch');
6	// 置換の対象とするsrc属性の末尾の文字列。
7	var sp = '_sp.';
8	var pc = '_pc.';
9	// 画像を切り替えるウィンドウサイズ。
10	var replaceWidth = 769;
11
12	function imageSwitch() {
13		// ウィンドウサイズを取得する。
14		var windowWidth = parseInt($(window).width());
15
16		// ページ内にあるすべての`.js-image-switch`に適応される。
17		$elem.each(function () {
18			var $this = $(this);
19			// ウィンドウサイズが768px以上であれば_spを_pcに置換する。
20			if (windowWidth >= replaceWidth) {
21				$this.attr('src', $this.attr('src').replace(sp, pc));
22				// ウィンドウサイズが768px未満であれば_pcを_spに置換する。
23			} else {
24				$this.attr('src', $this.attr('src').replace(pc, sp));
25			}
26		});
27	}
28	imageSwitch();
29	// 動的なリサイズは操作後0.2秒経ってから処理を実行する。
30	var resizeTimer;
31	$(window).on('resize', function () {
32		clearTimeout(resizeTimer);
33		resizeTimer = setTimeout(function () {
34			imageSwitch();
35		}, 50);
36	});
37
38	//ハンバーガーメニュー
39	$('#nav_toggle,#nav_toggle2').on('click', function () {
40		$('body').toggleClass('open');
41	});
42	$('.icon_search,#nav_search_toggle').on('click', function () {
43		$('body').toggleClass('open2');
44	});
45	// 	$('.wrap_menu,.inner_search_menu').on('click', function () {
46	// 		$('body').removeClass('open open2');
47	// 	});
48	//ハンバーガーメニュー 押したら閉じる(アンカーリンク用)
49	$('.g_nav a[href]').on('click', function(event) {
50		$('#nav_toggle').trigger('click');
51	});
52
53	$(window).on('load', function() {
54		var urlHash = location.hash;
55		if(urlHash) {
56			$('body,html').stop().scrollTop(0);
57			setTimeout(function(){
58				var target = $(urlHash);
59				var position = target.offset().top;
60				$('body,html').stop().animate({scrollTop:position}, 500);
61			}, 100);
62		}
63		$('a[href^="#"]').click(function() {
64			var href= $(this).attr("href");
65			var target = $(href);
66			var position = target.offset().top;
67			$('body,html').stop().animate({scrollTop:position}, 500);   
68		});
69	});
70
71
72
73	//途中からハンバーガーメニューと検索窓の色を変更
74	$(window).on('load', function () {
75		var navPos = $( '.wrap_fixed' ).offset().top; // グローバルメニューの位置
76		var lang = $( '.la_select' ).offset().top; // 翻訳の位置
77		var navHeight = $( '.wrap_keyimage' ).outerHeight(); // グローバルメニューの高さ
78		var mountainHeight = $( '.wrap_famous_mountain_top' ).outerHeight(); // グローバルメニューの高さ
79		var recommendedHeight = $( '.keyimage_recommended_route_single' ).outerHeight(); // グローバルメニューの高さ
80
81		$( window ).on( 'scroll', function() {
82			if ( $( this ).scrollTop() > navHeight ) {
83				$( '.icon_home a' ).css('fill','#000');
84				$( '.nav_toggle span' ).css('background','#000');
85				$( '.icon_search' ).css('color','#000');
86				// 				$( '.la_select' ).css('color','#000').addClass('on');
87				// 				$( '#google_language_translator .goog-te-gadget .goog-te-combo option' ).css('background','#fff');
88			} else if ( $( this ).scrollTop() > mountainHeight ) {
89				$( '.icon_home a' ).css('fill','#000');
90				$( '.nav_toggle span' ).css('background','#000');
91				$( '.icon_search' ).css('color','#000');
92				// 				$( '.la_select' ).css('color','#000').addClass('on');
93				// 				$( '#google_language_translator .goog-te-gadget .goog-te-combo option' ).css('background','#fff');
94			} else if ( $( this ).scrollTop() > recommendedHeight ) {
95				$( '.icon_home a' ).css('fill','#000');
96				$( '.nav_toggle span' ).css('background','#000');
97				$( '.icon_search' ).css('color','#000');
98				// 				$( '.la_select' ).css('color','#000').addClass('on');
99				// 				$( '#google_language_translator .goog-te-gadget .goog-te-combo option' ).css('background','#fff');
100			} else {
101				$( '.icon_home a' ).css('fill','#fff');
102				$( '.nav_toggle span' ).css('background','#fff');
103				$( '.icon_search' ).css('color','#fff');
104				// 				$( '.la_select' ).css('color','#fff').removeClass('on');
105				// 				$( '#google_language_translator .goog-te-gadget .goog-te-combo option' ).css('background','#454545');
106			}
107		});
108	});
109
110	if (window.matchMedia( "(max-width: 768px)" ).matches) {
111		// モデルコーススライダー
112		$('.spot_slider').slick({
113			autoplay: true,
114			arrows: false,
115			centerMode: true,
116			centerPadding: '10%',
117			slidesToShow: 1,
118		});
119
120		//魅力スライダー
121		$('.wrap_attraction_area_slider').slick({
122			infinite: true,
123			autoplay: true,
124			autoplaySpeed: 0, //自動再生のスライド切り替えまでの時間を設定
125			speed: 8000, //スライドが流れる速度を設定
126			cssEase: "linear", //スライドの流れ方を等速に設定
127			slidesToShow: 1,
128			slidesToScroll: 1,
129			centerMode: true,
130			centerPadding: "10%",
131		});
132
133		//魅力アコーディオン
134		$('.attraction_area_contents_head').on('click',function(){
135			$(this).next().slideToggle();
136		});
137		$('.ac_close').on('click',function(){
138			$(this).parent().slideToggle();
139		});
140
141		//魅力四季アコーディオン
142		$('.img_seasons').on('click',function(){
143			$(this).next().slideToggle();
144		});
145		$('.btn_close_seasons').on('click',function(){
146			$(this).parent().slideToggle();
147		});
148	}
149
150	//魅力しそう森林王国とはアコーディオン
151	$('.ttl_h3_about2').on('click',function(){
152		$(this).toggleClass('on').next().slideToggle();
153	});
154
155	//魅力財団の概要アコーディオン
156	$('.ttl_foundation').on('click',function(){
157		$(this).toggleClass('on').next().slideToggle();
158	});
159
160	//森林セラピー受講・料金案内タブメニュー
161	$('.ul_corse_tab_nav>li').click(function () {
162		console.log('click');
163		var num = $(this).parent().children('li').index(this);
164		$('.ul_corse_tab_nav').each(function () {
165			$('>li', this).removeClass('on').eq(num).addClass('on');
166		});
167		$('.tab_contents').hide().eq(num).show();
168	}).first().click();
169	$('.ul_corse_tab_nav>li').click(function () {
170		var speed = 400;
171		var href = $(this).attr("data-url");
172		var target = $(href == "#" || href == "" ? 'html' : href);
173		var position = target.offset().top;
174		$('body,html').animate({
175			scrollTop: position
176		}, speed, 'swing');
177		return false;
178	});
179
180	//イベントスライダー
181	$('.wrap_event_contents_top').slick({
182		infinite: true,
183		autoplay: true,
184		dots: true,
185		slidesToShow: 3,
186		slidesToScroll: 1,
187		variableWidth: true,
188
189		responsive: [
190			{
191				breakpoint: 768,
192				settings: {
193					arrows: false,
194					centerMode: true,
195					centerPadding: '10%',
196					slidesToShow: 1,
197					variableWidth: false,
198				}
199			},
200		]
201	});
202
203	//セラピーロードスライダー
204	$('.wrap_therapy_road_slider').slick({
205		infinite: true,
206		autoplay: true,
207		autoplaySpeed: 0, //自動再生のスライド切り替えまでの時間を設定
208		speed: 5000, //スライドが流れる速度を設定
209		cssEase: "linear", //スライドの流れ方を等速に設定
210		slidesToShow: 4,
211		slidesToScroll: 1,
212		responsive: [
213			{
214				breakpoint: 768,
215				settings: {
216					slidesToShow: 2,
217				}
218			},
219		]
220	});
221
222	//MW WPform エラー時
223	$('.error').siblings().addClass('error-pink');
224
225	//イベントフォーム2で会場がオンラインの場合
226	$("#venue").on("change", function() {
227		$('.dt_terminal,.dd_terminal').hide();
228		var shop = $(this).val();
229		if ( shop == 'オンライン' ) {
230			$('.dt_terminal,.dd_terminal').show();
231		}
232	}).trigger('change');
233});
234
235// デイトピッカー
236$(function() {
237	var date = new Date;// 月末日をセット
238	date.setMonth(date.getMonth() + 1, 0); // 当月, 0日(1日の前日)
239	$('.calendar').datepicker({
240		dateFormat: 'yy-mm-dd',
241		minDate: '0',
242		language: 'ja',
243		closeText: "閉じる",
244		prevText: "<前",
245		nextText: "次>",
246		currentText: "今日",
247		monthNames: [ "1月","2月","3月","4月","5月","6月",
248					 "7月","8月","9月","10月","11月","12月" ],
249		monthNamesShort: [ "1月","2月","3月","4月","5月","6月",
250						  "7月","8月","9月","10月","11月","12月" ],
251		dayNames: [ "日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日" ],
252		dayNamesShort: [ "日","月","火","水","木","金","土" ],
253		dayNamesMin: [ "日","月","火","水","木","金","土" ],
254		weekHeader: "週",
255		dateFormat: "yy/mm/dd",
256		firstDay: 0,
257		isRTL: false,
258		showMonthAfterYear: true,
259		yearSuffix: "å¹´",
260	});
261});
262
263
264
265
266// デイトピッカー
267// https://shiso.or.jp/climbing_event_form1?post_id=11908
268$(function() {
269	var date = new Date;// 月末日をセット
270	date.setMonth(date.getMonth() + 1, 0); // 当月, 0日(1日の前日)
271	$('.calendar3').datepicker({
272		dateFormat: 'yy-mm-dd',
273		//minDate: '0',
274		language: 'ja',
275		closeText: "閉じる",
276		prevText: "<前",
277		nextText: "次>",
278		currentText: "今日",
279		monthNames: [ "1月","2月","3月","4月","5月","6月",
280					 "7月","8月","9月","10月","11月","12月" ],
281		monthNamesShort: [ "1月","2月","3月","4月","5月","6月",
282						  "7月","8月","9月","10月","11月","12月" ],
283		dayNames: [ "日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日" ],
284		dayNamesShort: [ "日","月","火","水","木","金","土" ],
285		dayNamesMin: [ "日","月","火","水","木","金","土" ],
286		weekHeader: "週",
287		dateFormat: "yy/mm/dd",
288		firstDay: 0,
289		isRTL: false,
290		showMonthAfterYear: true,
291		yearSuffix: "å¹´",
292	});
293});
294
295
296
297
298
299
300
301
302
303
304// デイトピッカー  平日選択できないように(セラピーバイク)
305$(function() {
306    var date = new Date; // 月末日をセット
307    date.setMonth(date.getMonth() + 1, 0); // 当月, 0日(1日の前日)
308    $('.calendar2').datepicker({
309        dateFormat: 'yy-mm-dd',
310        minDate: '+1d',
311        language: 'ja',
312        closeText: "閉じる",
313        prevText: "<前",
314        nextText: "次>",
315        currentText: "今日",
316        monthNames: [ "1月","2月","3月","4月","5月","6月",
317                     "7月","8月","9月","10月","11月","12月" ],
318        monthNamesShort: [ "1月","2月","3月","4月","5月","6月",
319                          "7月","8月","9月","10月","11月","12月" ],
320        dayNames: [ "日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日" ],
321        dayNamesShort: [ "日","月","火","水","木","金","土" ],
322        dayNamesMin: [ "日","月","火","水","木","金","土" ],
323        weekHeader: "週",
324        dateFormat: "yy/mm/dd",
325        firstDay: 0,
326        isRTL: false,
327        showMonthAfterYear: true,
328        yearSuffix: "å¹´",
329    });
330
331	 // 特定の平日を追加
332    var specialDates = [
333		"2024-07-01",
334		"2024-09-16",
335		"2024-09-23",
336		"2024-10-14",
337		
338//		"2024-08-15"
339	];
340
341    $('.calendar2').datepicker('option', 'beforeShowDay', function(date) {
342        var day = date.getDay();
343        var formattedDate = $.datepicker.formatDate('yy-mm-dd', date);
344
345        var isSpecialDate = specialDates.includes(formattedDate);
346        var isWeekend = (day == 0 || day == 6); // 土日
347
348        if (isSpecialDate || isWeekend) {
349            return [true]; // 選択可能
350        } else {
351            return [false]; // 選択不可
352        }
353    });
354});
355
356$('.wpcf7-list-item-label').each(function () {
357	var text = $(this).html();
358	$(this).html(text.replace('&lt;br&gt;', '<br>'));
359});

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.