PageSourceSearch

https://www.cafe-kofs.com/js/basis.js

js cafe-kofs.com collected 2026-10-08 04:53:03 UTC 8,298 bytes, 357 lines download raw bytes

1// メニューロールオーバー
2
3$(function(){
4
5	$("img.rollover").mouseover(function(){
6
7		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
8
9	}).mouseout(function(){
10
11		$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
12
13	});
14
15});
16
17// hover
18$(function(){
19    var menuBox = $("a img:not(.rollover) ");
20     
21    menuBox.hover(function(){ 
22        $(this).stop().animate({'opacity' : '0.5'}, 200);  
23    },function(){
24        $(this).stop().animate({'opacity' : '1'}, 200);
25    }
26    );
27});
28
29(function($){
30$(function() {
31	//TOPへスクロール
32		var btn_top = $('.toTop');
33		
34		$(">a",btn_top).click(function(){
35			$("body,html").animate({
36				scrollTop: 0
37			}, 500);
38			return false;
39	});
40	//スクロール
41		$("a[href^=#]").click(function(){
42			var targetY = $($(this).attr('href')).offset().top;
43			$('html,body').animate({scrollTop: targetY}, 800, 'swing');
44			return false;
45	});
46});
47})(jQuery);
48
49//top
50$(function() {
51	var topBtn = $('#page-top');	
52	topBtn.hide();
53	//スクロールが100に達したらボタン表示
54	$(window).scroll(function () {
55		if ($(this).scrollTop() > 50) {
56			topBtn.fadeIn();
57		} else {
58			topBtn.fadeOut();
59		}
60	});
61	//スクロールしてトップ
62    topBtn.click(function () {
63		$('body,html').animate({
64			scrollTop: 0
65		}, 500);
66		return false;
67    });
68});
69
70$(function(){
71	if(location.hash != ''){
72		$(location.hash).fadeIn();
73	}else{
74		$('panel').show();
75	}
76
77$(".tab li").click(function(){
78	var index = $(this).parent("ul").children("li").index(this);
79	$(this).siblings("li").removeClass("active");
80	$(this).addClass("active");
81	$(this).parent("ul").nextAll(".panel").hide();	
82	$(this).parent("ul").nextAll(".panel").eq(index).fadeIn();	
83	return false;
84});
85});
86	
87
88/* smartphone */
89$(function(){
90	if(location.hash != ''){
91		$(location.hash).fadeIn();
92	}else{
93		$('panel').show();
94	}
95
96$(".tab li").click(function(){
97	var index = $(this).parent("ul").children("li").index(this);
98	$(this).siblings("li").removeClass("active");
99	$(this).addClass("active");
100	$(this).parent("ul").nextAll(".panel").hide();	
101	$(this).parent("ul").nextAll(".panel").eq(index).fadeIn();	
102	return false;
103});
104});
105	
106
107
108$(function() {
109	$('#menu_btn1').click(function(){
110		$("#dmenu1").slideToggle(
111	    "speed",
112	    function(){
113	    }
114		);
115		
116	});
117});
118
119
120$(function() {
121	$('#menu_btn2').click(function(){
122		$("#dmenu2").slideToggle(
123	    function(){
124	    }
125		);
126		
127	});
128});
129
130$(function() {
131	$('#menu_btn3').click(function(){
132		$("#dmenu3").slideToggle(
133	    "speed",
134	    function(){
135	    }
136		);
137		
138	});
139});
140
141$(function() {
142	$('#menu_btn1').click(function(){
143		$("#dmenu2, #dmenu3").hide(
144	    "speed",
145	    function(){
146	    }
147		);
148		
149	});
150});
151
152$(function() {
153	$('#menu_btn2').click(function(){
154		$("#dmenu3, #dmenu1").hide(
155	    "speed",
156	    function(){
157	    }
158		);
159		
160	});
161});
162
163$(function() {
164	$('#menu_btn3').click(function(){
165		$("#dmenu2, #dmenu1").hide(
166	    "speed",
167	    function(){
168	    }
169		);
170		
171	});
172});
173$(function() {
174	$('#menu,#gmenu a').click(function(){
175		$("#gmenu").slideToggle(
176	    "speed",
177	    function(){
178			
179	    }
180		);
181	});
182});
183
184// accordion 
185$(function(){
186     
187$(".accordion p").click(function(){
188    $(this).next("ul").slideToggle();
189    $(this).children("span").toggleClass("open");
190}); 
191 
192$(".accordion dt").click(function(){
193    $(this).next("dd").slideToggle();
194    $(this).next("dd").siblings("dd").slideUp();
195    $(this).toggleClass("open");    
196    $(this).siblings("dt").removeClass("open");
197});
198 
199});
200
201// accordion 
202;(function($){
203	var touch = false;
204	$('#humberger').on('click touchstart',function(e){
205		switch (e.type) {
206			case 'touchstart':
207				drawerToggle();
208				touch = true;
209				return false;
210			break;
211			case 'click':
212				if(!touch)
213					 drawerToggle();
214				return false;
215			break;
216		 }
217		function drawerToggle(){
218			$('body').toggleClass('drawer-opened');
219			touch = false;
220		}
221	})
222	$('#overlay').on('click touchstart',function(){
223		$('body').removeClass('drawer-opened');
224	})
225})(jQuery);
226
227$(window).scroll(function(){
228	if ($(window).scrollTop() > 20) {
229		$('header').addClass('headscroll');
230	} else {
231		$('header').removeClass('headscroll');
232	}
233});
234
235
236$(window).on('load', function () {
237  $('#js-loader').fadeOut(3000);
238});
239
240$(function () {
241    $(".faq-question").click(function(){
242        $(this).next().slideToggle();
243    });
244});
245
246$(window).on('load', function() {
247	var urlHash = location.hash;
248	var headerHight = 100; //ヘッダの高さ
249	if(urlHash != ""){
250		var target = $(urlHash);
251		var position = target.offset().top - headerHight; //ヘッダの高さ分位置をずらす
252		$("html, body").animate({ scrollTop: position }, 550, "swing");
253	}
254});
255
256
257// glowAnimeにglowというクラス名を付ける定義
258function GlowAnimeControl(selector, delay) {
259    $(selector).each(function () {
260        var elemPos = $(this).offset().top - 500;
261        var scroll = $(window).scrollTop();
262        var windowHeight = $(window).height();
263        if (scroll >= elemPos - windowHeight) {
264            $(this).addClass("glow");
265        } else {
266            $(this).removeClass("glow");
267        }
268    });
269}
270
271// 画面をスクロールをしたら動かしたい場合の記述
272$(window).scroll(function () {
273    GlowAnimeControl('.glowAnime', 0); /* アニメーション用の関数を呼ぶ*/
274    GlowAnimeControl('.glowAnime2', 3000); /* アニメーション用の関数を呼ぶ*/
275});
276
277// 画面が読み込まれたらすぐに動かしたい場合の記述
278$(window).on('load', function () {
279    //spanタグを追加する
280    var element = $(".glowAnime, .glowAnime2");
281    element.each(function () {
282        var text = $(this).text();
283        var textbox = "";
284        text.split('').forEach(function (t, i) {
285            if (t !== " ") {
286                var delay = i < 10 ? '.' + i + 's;' : (i / 10) + 's;';
287                textbox += '<span style="animation-delay:' + delay + '">' + t + '</span>';
288            } else {
289                textbox += t;
290            }
291        });
292        $(this).html(textbox);
293    });
294
295    // 3秒後に.glowAnimeを開始する
296    setTimeout(function () {
297        GlowAnimeControl('.glowAnime', 0);
298    }, 3000);
299
300    // 5秒後に.glowAnime2を開始する
301    setTimeout(function () {
302        GlowAnimeControl('.glowAnime2', 0);
303    }, 5000);
304});
305
306
307// 動きのきっかけの起点となるアニメーションの名前を定義
308function BgFadeAnime(){
309
310    // 背景色が伸びて出現(左から右)
311  $('.bgLRextendTrigger').each(function(){ //bgLRextendTriggerというクラス名が
312    var elemPos = $(this).offset().top-50;//要素より、50px上の
313    var scroll = $(window).scrollTop();
314    var windowHeight = $(window).height();
315    if (scroll >= elemPos - windowHeight){
316      $(this).addClass('bgLRextend');// 画面内に入ったらbgLRextendというクラス名を追記
317    }else{
318      $(this).removeClass('bgLRextend');// 画面外に出たらbgLRextendというクラス名を外す
319    }
320  });
321
322   // 文字列を囲う子要素
323  $('.bgappearTrigger').each(function(){ //bgappearTriggerというクラス名が
324    var elemPos = $(this).offset().top-50;//要素より、50px上の
325    var scroll = $(window).scrollTop();
326    var windowHeight = $(window).height();
327    if (scroll >= elemPos - windowHeight){
328      $(this).addClass('bgappear');// 画面内に入ったらbgappearというクラス名を追記
329    }else{
330      $(this).removeClass('bgappear');// 画面外に出たらbgappearというクラス名を外す
331    }
332  });
333}
334
335// 画面をスクロールをしたら動かしたい場合の記述
336  $(window).scroll(function (){
337    BgFadeAnime();/* アニメーション用の関数を呼ぶ*/
338  });// ここまで画面をスクロールをしたら動かしたい場合の記述
339
340// 画面が読み込まれたらすぐに動かしたい場合の記述
341  $(window).on('load', function(){
342    BgFadeAnime();/* アニメーション用の関数を呼ぶ*/
343  });// ここまで画面が読み込まれたらすぐに動かしたい場合の記述
344
345
346$(window).on('load', function(){
347  if ($('#splash').length) {
348    $('#splash').delay(10).fadeOut(800, function(){
349      $('body').addClass('appear');
350    });
351  }
352  /*
353else {
354  console.warn('#splashが存在しませんでした');
355}
356*/
357});

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.