PageSourceSearch

http://www.kashiwayahonten.com/wp_kashiwayahonten/wp-content/themes/kashiwaya-theme/js/common.js

js kashiwayahonten.com collected 2026-10-08 20:21:44 UTC 5,814 bytes, 239 lines download raw bytes

1var windowSize = $(window).width();
2if (windowSize <  768) {
3	$(function(){
4//スライダー基本
5		$('.slide-items').slick({
6			arrows: true,
7			dots: false,
8			autoplay: true,
9			autoplaySpeed: 4000,
10			infinite: true,
11		});
12//スライダー宿泊プラン
13		$(".slide-reserve").slick({
14			arrows: true,
15			dots: false,
16			autoplay: false,
17			autoplaySpeed: 4000,
18			infinite: true,
19			centerMode:true,
20			centerPadding:"10%",
21		});
22//スライダーオートなし
23		$('.slide-noautoplay').slick({
24			arrows: true,
25			dots: false,
26			autoplay: false,
27			autoplaySpeed: 4000,
28			infinite: true,
29			centerMode:true,
30			centerPadding:"10%",
31		});
32//スライダーTOP
33		$('.slide-concept').slick({
34			arrows: true,
35			dots: false,
36			autoplay: true,
37			autoplaySpeed: 4000,
38			infinite: true,
39		});
40//スライダードット付き
41		$('.slide-suite').slick({
42			arrows: true,
43			dots: true,
44			autoplay: true,
45			autoplaySpeed: 4000,
46			infinite: true,
47			slidesToShow: 1,
48			slidesToScroll: 1,
49		});
50//スライダーオートスクロール
51		$(".slide-linear").slick({
52			arrows: false,
53			dots: false,
54			autoplay: true,
55			autoplaySpeed: 0,
56			speed: 15000,
57			cssEase: "linear",
58			infinite: true,
59			slidesToShow: 2,
60		});
61	});
62} else {
63	$(function(){
64//スライダー基本
65		$('.slide-items').slick({
66			arrows: true,
67			dots: false,
68			autoplay: true,
69			autoplaySpeed: 4000,
70			infinite: true,
71			slidesToShow: 2,
72			slidesToScroll: 1,
73		});
74//スライダー宿泊プラン
75		$(".slide-reserve").slick({
76			arrows: true,
77			dots: false,
78			autoplay: false,
79			autoplaySpeed: 4000,
80			infinite: true,
81			centerMode:true,
82			centerPadding:"35%",
83		});
84//スライダーオートなし
85		$('.slide-noautoplay').slick({
86			arrows: true,
87			dots: false,
88			autoplay: false,
89			autoplaySpeed: 4000,
90			infinite: true,
91			centerMode:true,
92			centerPadding:"15%",
93		});
94//スライダードット付き
95		$('.slide-suite').slick({
96			arrows: true,
97			dots: true,
98			autoplay: true,
99			autoplaySpeed: 4000,
100			infinite: true,
101			slidesToShow: 1,
102			slidesToScroll: 1,
103		});
104//スライダーオートスクロール
105		$(".slide-linear").slick({
106			arrows: false,
107			dots: false,
108			autoplay: true,
109			autoplaySpeed: 0,
110			speed: 30000,
111			cssEase: "linear",
112			infinite: true,
113			slidesToShow: 3,
114		});
115	});
116}
117//スクロールフェード
118$(window).on('scroll', function (){
119  var elem = $('.fadeup');
120  var isInview = 'inview';
121  elem.each(function () {
122    var elemOffset = $(this).offset().top;
123    var scrollPos = $(window).scrollTop();
124    var wh = $(window).height();
125    if(scrollPos > elemOffset - wh + (wh / 5) ){
126      $(this).addClass(isInview);
127    }
128  });
129});
130$(window).on('scroll', function (){
131	var elem = $('.fade');
132  var isInview = 'inview';
133  elem.each(function () {
134    var elemOffset = $(this).offset().top;
135    var scrollPos = $(window).scrollTop();
136    var wh = $(window).height();
137    if(scrollPos > elemOffset - wh + (wh / 5) ){
138      $(this).addClass(isInview);
139    }
140  });
141});
142//ハンバーガーメニュー
143$(function() {
144    'use strict';
145var h_nav = $('#h_btn'),
146    x_nav = $('body, #h_btn, #h_content');
147    h_nav.on('click', function() {
148    x_nav.toggleClass('active');
149    });
150});
151//アコーディオン
152$(function() {
153	$(".accordion").each(function() {
154			var accordion = $(this);
155		$(this).find(".switch").click(function() {
156		var targetContentWrap = $(this).next(".contentWrap");
157		if ( targetContentWrap.css("display") === "none" ) {
158			accordion.find(".contentWrap").slideUp();
159			accordion.find(".switch.open").removeClass("open");
160		}
161		targetContentWrap.slideToggle();
162		$(this).toggleClass("open");
163		});
164	});
165});
166//アコーディオン
167$(function() {
168	$(".language_link").each(function() {
169			var accordion = $(this);
170		$(this).find(".dormenu").click(function() {
171		var targetContentWrap = $(this).next(".linkbox");
172		if ( targetContentWrap.css("display") === "none" ) {
173			accordion.find(".linkbox").slideUp();
174			accordion.find(".dormenu.open").removeClass("open");
175		}
176		targetContentWrap.slideToggle();
177		$(this).toggleClass("open");
178		});
179	});
180});
181//グラデーションアコーディオン
182const elements = document.querySelectorAll('.more');
183
184Array.from(elements).forEach(function(el){
185	const btn = el.querySelector('.more__btn');
186	const content = el.querySelector('.more__content');
187	
188	content.style.maxHeight = content.scrollHeight + 'px';
189	content.classList.add('open');
190	btn.textContent = '閉じる';
191
192	btn.addEventListener('click', function(){
193		if(!content.classList.contains('open')){
194			content.style.maxHeight = content.scrollHeight + 'px';
195			content.classList.add('open');
196			btn.textContent = '閉じる';
197		} else {
198			content.style.maxHeight = '100px';
199			content.classList.remove('open');
200			btn.textContent = '通常会席をすべて表示する';
201		}
202	});
203});
204//スムーススクロール
205$(function(){
206  $('a[href^="#"]').click(function(){
207    var adjust = 0;
208    var speed = 400;
209    var href= $(this).attr("href");
210    var target = $(href == "#" || href == "" ? 'html' : href);
211    var position = target.offset().top + adjust;
212    $('body,html').animate({scrollTop:position}, speed, 'swing');
213    return false;
214  });
215});
216// ファーストビュー発火
217$(function() {
218  $(window).scroll(function() {
219    var scroll = $(window).scrollTop();
220    var windowHeight = $(window).height();
221    $('.inview-text--up').each(function() {
222      var elemPos = $(this).offset().top;
223      if (scroll > elemPos - windowHeight + 100) {
224        $(this).css({
225          'opacity': '1',
226          'transform': 'translateY(0)'
227        });
228      }
229    });
230  });
231  jQuery(window).scroll();
232});
233//慣性スクロール
234const lenis = new Lenis();
235function raf(time) {
236  lenis.raf(time);
237  requestAnimationFrame(raf);
238}
239requestAnimationFrame(raf);

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.