PageSourceSearch

https://www.bearmonte.jp/ko/common/js/common.js?20240418

js bearmonte.jp collected 2026-10-04 09:50:42 UTC 5,931 bytes, 221 lines download raw bytes

1
2
3var windowWidth = $(window).width();
4
5$(window).on('load resize', function(){
6	currentItem = $(".current-item");
7		if (currentItem[0]) {
8			currentItem.css({
9			"width": currentItem.width(),
10			"left": currentItem.position().left
11		});
12	}
13
14	var w = $(window).width();
15	var x = 1100;
16
17	if (w <= x) {	
18		$('nav').removeAttr('id');
19	}else{
20		$('nav').attr('id', 'menu_bar');
21	}
22
23	// ページのURLを取得
24	const url = $(location).attr('href'),
25	// headerの高さを取得してそれに30px追加した値をheaderHeightに代入
26	headerHeight = $('header').outerHeight() + 68;
27
28	// urlに「#」が含まれていれば
29	if(url.indexOf("#") != -1 ){
30		// urlを#で分割して配列に格納
31		const anchor = url.split("#"),
32		// 分割した最後の文字列(#◯◯の部分)をtargetに代入
33		target = $('#' + anchor[anchor.length - 1]),
34		// リンク先の位置からheaderHeightの高さを引いた値をpositionに代入
35		position = Math.floor(target.offset().top) - headerHeight;
36		// positionの位置に移動
37		$("html, body").animate({scrollTop:position}, 500);
38	}
39
40
41	ScrollReveal().reveal('.fadein', {
42		delay: 300, // アニメーション開始までの時間
43		duration: 1600, // アニメーション完了にかかる時間
44		origin: 'bottom', // 要素がどの方向から来るか
45		distance: '50px', // 移動する距離
46		mobile:false,
47		reset: false // フレームインの度に動かすか
48	});
49
50	//メニュー内を閉じておく
51	$('.globalMenuSp a[href]').click(function() {
52		$('.globalMenuSp').removeClass('active');
53		$('.hamburger').removeClass('active');
54		slider01.slick('setPosition');
55		slider02.slick('setPosition');
56	});
57
58});
59
60
61//body固定関数関数
62var bodyElm = $('body');
63var scrollPosi;
64function bodyFix() {
65	scrollPosi = $(window).scrollTop();
66	bodyElm.css({
67		'position': 'fixed',
68		'width': '100%',
69		'z-index': '0',
70		'top': -scrollPosi
71	});
72}
73
74//body fixリセット関数
75function bodyFixReset() {
76	bodyElm.css({
77		'position': 'relative',
78		'width': 'auto',
79		'top':'auto'
80	});
81	//scroll位置を調整
82	$("html, body").scrollTop(scrollPosi);
83}
84
85
86
87jQuery(document).ready(function($) {
88	//グローバルナビと上に戻るボタン スクロールしたら表示(pc)
89	var headNav = $("#fix_logo");
90
91	//scrollだけだと読み込み時困るのでloadも追加
92	$(window).on('load scroll resize', function(){
93		//現在の位置が50px以上かつ、クラスwhiteが付与されていない時
94		if($(this).scrollTop() > 400 && headNav.hasClass('active') == false && windowWidth > 900) {
95			//headerの高さ(59px)分上に設定
96			headNav.css({"top": '-68px'});
97			//クラスwhiteを付与
98			headNav.addClass('active');
99			//位置を0に設定し、アニメーションのスピードを指定
100			headNav.animate({"top": 0},400);
101		}
102		//現在の位置が10px以下かつ、クラスwhiteが付与されている時
103		else if($(this).scrollTop() < 400 && headNav.hasClass('active') == true && windowWidth > 900){
104			//クラスwhiteの除去
105			headNav.removeClass('active');
106			headNav.animate({"top": '-68px'},400);
107		}
108		if(windowWidth <= 900){
109			//console.log(windowWidth);
110			headNav.css({"top": '0'});
111			// $("#to_top").css({"display": 'none'});
112		}
113	});
114
115
116	if(windowWidth > 900){
117		$('.hamburger').click(function() {
118
119			$(this).toggleClass('active');
120			if ($(this).hasClass('active')) {
121				$('.globalMenuSp').addClass('active');
122			} else {
123				$('.globalMenuSp').removeClass('active');
124				slider01.slick('setPosition');
125				slider02.slick('setPosition');
126			}
127		});
128	}else{
129		$('.hamburger').click(function() {
130			//スクロール量を保存
131			// var scrollPos;
132			$(this).toggleClass('active');
133			if ($(this).hasClass('active')) {
134				// scrollPos = $(window).scrollTop();
135				$('.globalMenuSp').addClass('active');
136				// $('body').addClass('fixed').css({ top: -scrollPos });
137				bodyFix();
138				return false;
139			} else {
140				$('.globalMenuSp').removeClass('active');
141				// $('body').removeClass('fixed').css({ top: 0 });
142				// $(window).scrollTop(0,scrollPos);
143				bodyFixReset();
144				slider01.slick('setPosition');
145				slider02.slick('setPosition');
146				// return false;
147			}
148		});
149
150		//メニュー内を閉じておく
151		$('.globalMenuSp a[href]').click(function() {
152			$('.globalMenuSp').removeClass('active');
153			$('.hamburger').removeClass('active');
154			bodyFixReset();
155			slider01.slick('setPosition');
156			slider02.slick('setPosition');
157		});
158
159		//下予約ボタン
160		// var sp_bottom_btn = $("#sp_rsv_fix");
161		// sp_bottom_btn.click(function() {
162		// 	window.open("https://asp.hotel-story.ne.jp/ver3d/planlist.asp?hcod1=63940&hcod2=001&mode=seek&clrmode=true&reffrom=");
163		// });
164	}
165});
166
167
168
169$(function(){
170  $('a[href^="#"]').click(function() {
171    var speed = 400;
172    var href = $(this).attr("href");
173    var target = $(href == "#" ? 'html' : href);
174    var position = target.offset().top;
175	var w = $(window).width();
176	var x = 900;
177
178	if (w > x) {	
179		/* この行を追加 */
180		position -= 68; /* ヘッダーの高さ分のpxをマイナスする */
181	}	
182
183    $('body,html').animate({scrollTop:position}, speed, 'swing');
184    return false;
185  });
186});
187
188
189
190var slider01 = $('.slick01').slick({
191	autoplay: true,
192	dots: true,
193	arrows: false,
194	autoplaySpeed: 2000,
195	speed:2000,
196	fade: true,
197	swipe: true,
198});
199
200var slider02 =$('.slick02').slick({
201	autoplay: true,
202	dots: false,
203	arrows: false,
204	autoplaySpeed: 2000,
205	speed:2000,
206	fade: true,
207	swipe: true,
208});
209
210//ダイレクトイン
211directInSearchPanelConfig = {
212	locale: "ko",
213	rooms: "1..3", // 部屋数の選択可能範囲
214	guests: [
215		{
216			type: 0,
217			range: "1..5", // 人数 (大人) の選択可能範囲
218		},
219	],
220	defaultNoDate: false,
221} 

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.