PageSourceSearch

https://bijotodance.com/wp-content/themes/rumble_tcd058/js/functions.js?ver=1.1

js bijotodance.com collected 2026-10-02 22:27:53 UTC 10,754 bytes, 383 lines download raw bytes

1jQuery(function($){
2
3	/**
4	 * グローバルナビゲーション モバイル
5	 */
6	$('#js-menu-button').click(function() {
7		var w = window.innerWidth || $('#js-header').width();
8		if ($('body').hasClass('is-responsive') && w < 992) {
9			$(this).toggleClass('is-active');
10			$('#js-global-nav').slideToggle(500);
11		}
12		return false;
13	});
14	$('#js-global-nav .menu-item-has-children > a span').click(function() {
15		var w = window.innerWidth || $('#js-header').width();
16		if ($('body').hasClass('is-responsive') && w < 992) {
17			$(this).toggleClass('is-active');
18			$(this).closest('.menu-item-has-children').toggleClass('is-active').find('> .sub-menu').slideToggle(300);
19		}
20		return false;
21	});
22
23	/**
24	 * ヘッダー検索
25	 */
26	$('#js-header #js-search-button').click(function() {
27		$(this).closest('#js-header').toggleClass('is-header-search-active');
28		return false;
29	});
30
31	/**
32	 * メガメニュー
33	 */
34	if ($('#js-header .p-megamenu').length) {
35		var hide_megamenu_timer = {};
36		var hide_megamenu_interval = function(menu_id) {
37			if (hide_megamenu_timer[menu_id]) {
38				clearInterval(hide_megamenu_timer[menu_id]);
39				hide_megamenu_timer[menu_id] = null;
40			}
41			hide_megamenu_timer[menu_id] = setInterval(function() {
42				if (!$('#menu-item-' + menu_id).is(':hover') && !$('#p-megamenu--' + menu_id).is(':hover')) {
43					clearInterval(hide_megamenu_timer[menu_id]);
44					hide_megamenu_timer[menu_id] = null;
45					$('#menu-item-' + menu_id + ', #p-megamenu--' + menu_id).removeClass('is-active');
46				}
47			}, 20);
48		};
49		$('#js-global-nav .menu-megamenu').hover(
50			function(){
51				var menu_id = $(this).attr('id').replace('menu-item-', '');
52				var w = window.innerWidth || $('#js-header').width();
53				if (hide_megamenu_timer[menu_id]) {
54					clearInterval(hide_megamenu_timer[menu_id]);
55					hide_megamenu_timer[menu_id] = null;
56				}
57				if (!$('body').hasClass('is-responsive') || w >= 992) {
58					$(this).addClass('is-active');
59					$('#p-megamenu--' + menu_id).addClass('is-active');
60				}
61			},
62			function(){
63				var menu_id = $(this).attr('id').replace('menu-item-', '');
64				hide_megamenu_interval(menu_id);
65			}
66		);
67		$('#js-header').on('mouseout', '.p-megamenu', function(){
68			var menu_id = $(this).attr('id').replace('p-megamenu--', '');
69			hide_megamenu_interval(menu_id);
70		});
71
72		var set_megamenu_top = function() {
73			if ($('#js-header').hasClass('is-header-fixed')) {
74				$('.p-megamenu').css('top', $('#js-global-nav').height() + $('#wpadminbar').height());
75			} else {
76				$('.p-megamenu').css('top', $('#js-global-nav').offset().top + $('#js-global-nav').height() - $('#wpadminbar').height());
77			}
78		};
79		set_megamenu_top();
80		$(window).on('load resize', set_megamenu_top);
81
82		var megamenu_scroll_timer;
83		$(window).on('scroll', function(){
84			clearTimeout(megamenu_scroll_timer);
85			var w = window.innerWidth || $('#js-header').width();
86			if (!$('body').hasClass('is-responsive') || w >= 992) {
87				megamenu_scroll_timer = setTimeout(set_megamenu_top, 100);
88			}
89		});
90
91		/**
92		 * メガメニューB (type3)
93		 */
94		$('.p-megamenu--type3 > ul > li > a').hover(
95			function(){
96				var $li = $(this).closest('li');
97				$li.addClass('is-active');
98				$li.siblings('.is-active').removeClass('is-active');
99			},
100			function(){}
101		);
102
103		var set_megamenu_type3_height = function(){
104			$('.p-megamenu--type3').each(function(){
105				if ($(this).find('> ul > li').length < 5) {
106					$(this).find('> ul').css('minHeight', 0);
107					$(this).find('> ul').css('minHeight', $(this).find('.sub-menu li').height() + parseInt($(this).find('> ul').css('borderTopWidth'), 10));
108				}
109			});
110		};
111		set_megamenu_type3_height();
112		$(window).on('load resize', set_megamenu_type3_height);
113	}
114
115	/**
116	 * ページトップ
117	 */
118	var pagetop = $('#js-pagetop');
119	pagetop.hide().click(function() {
120		$('body, html').animate({
121			scrollTop: 0
122		}, 1000);
123		return false;
124	});
125	$(window).scroll(function() {
126		if ($(this).scrollTop() > 100) {
127			pagetop.fadeIn(1000);
128		} else {
129			pagetop.fadeOut(300);
130		}
131	});
132
133	/**
134	 * 記事一覧でのカテゴリークリック
135	 */
136	$('a span[data-url]').hover(
137		function(){
138			var $a = $(this).closest('a');
139			$a.attr('data-href', $a.attr('href'));
140			if ($(this).attr('data-url')) {
141				$a.attr('href', $(this).attr('data-url'));
142			}
143		},
144		function(){
145			var $a = $(this).closest('a');
146			$a.attr('href', $a.attr('data-href'));
147		}
148	);
149
150	/**
151	 * コメント
152	 */
153	if ($('#js-comment__tab').length) {
154		var commentTab = $('#js-comment__tab');
155		commentTab.find('a').click(function() {
156			if (!$(this).parent().hasClass('is-active')) {
157				$($('.is-active a', commentTab).attr('href')).animate({opacity: 'hide'}, 0);
158				$('.is-active', commentTab).removeClass('is-active');
159				$(this).parent().addClass('is-active');
160				$($(this).attr('href')).animate({opacity: 'show'}, 1000);
161			}
162			return false;
163		});
164	}
165
166	/**
167	 * カテゴリー ウィジェット
168	 */
169	$('.p-widget-categories li ul.children').each(function() {
170		$(this).closest('li').addClass('has-children');
171		$(this).hide().before('<span class="toggle-children"></span>');
172	});
173	$('.p-widget-categories .toggle-children').click(function() {
174		$(this).closest('li').toggleClass('is-active').find('> ul.children').slideToggle();
175	});
176
177	/**
178	 * アーカイブウィジェット
179	 */
180	if ($('.p-dropdown').length) {
181		$('.p-dropdown__title').click(function() {
182			$(this).toggleClass('is-active');
183			$('+ .p-dropdown__list:not(:animated)', this).slideToggle();
184		});
185	}
186
187	/**
188	 * フッターウィジェット
189	 */
190	if ($('#js-footer-widget').length) {
191		var footer_widget_resize_timer;
192		var footer_widget_layout = function(){
193			$('#js-footer-widget .p-widget').filter('.p-footer-widget__left, .p-footer-widget__right, .p-footer-widget__border-left, .p-footer-widget__border-top, .widget_nav_menu-neighbor').removeClass('p-footer-widget__left p-footer-widget__right p-footer-widget__border-left p-footer-widget__border-top widget_nav_menu-neighbor');
194			if ($('body').width() >= 768) {
195				var em_last, top, em_length = $('#js-footer-widget .p-widget').length;
196				$('#js-footer-widget .p-widget').each(function(i){
197					var pos = $(this).position();
198					if (pos.top !== top) {
199						top = pos.top;
200						if (i > 0) {
201							$(this).addClass('p-footer-widget__border-top');
202						}
203						if (pos.left < 5) {
204							$(this).addClass('p-footer-widget__left');
205						}
206						if (em_last) {
207							$(em_last).addClass('p-footer-widget__right');
208						}
209					// メニューの連続
210					} else if (em_last && $(em_last).hasClass('widget_nav_menu') && $(this).hasClass('widget_nav_menu')) {
211						$(this).addClass('widget_nav_menu-neighbor');
212					} else if (i > 0) {
213						$(this).addClass('p-footer-widget__border-left');
214					}
215					if (i + 1 == em_length) {
216						$(this).addClass('p-footer-widget__right');
217					}
218					em_last = this;
219				});
220			}
221		};
222		$(window).on('load', footer_widget_layout);
223		$(window).on('resize', function(){
224			clearTimeout(footer_widget_resize_timer);
225			footer_widget_resize_timer = setTimeout(footer_widget_layout, 100);
226		});
227	}
228
229	/**
230	 * object-fit: cover未対応ブラウザ対策
231	 */
232	var ua = window.navigator.userAgent.toLowerCase();
233	if(ua.indexOf('msie') > -1 || ua.indexOf('trident') > -1) {
234		// object-fit: cover前提のcssをリセット
235		var init_object_fit_cover = function(el) {
236			$(el).css({
237				width: 'auto',
238				height: 'auto',
239				maxWidth: 'none',
240				minWidth: '100%',
241				minHeight: '100%',
242				top : 0,
243				left : 0
244			});
245		};
246
247		// サイズに応じてcss指定
248		var fix_object_fit_cover = function(el) {
249			$(el).each(function(){
250				var $cl, cl_w, cl_h, cl_ratio, img_w, img_h, img_ratio, inc_ratio;
251				$cl = $(this).closest('.js-object-fit-cover');
252				cl_w = $cl.innerWidth();
253				cl_h = $cl.innerHeight();
254				cl_ratio = cl_w / cl_h;
255				img_w = $(this).width();
256				img_h = $(this).height();
257				img_ratio = img_w / img_h;
258				inc_ratio = cl_ratio - img_ratio;
259
260				// 同じ縦横比
261				if (inc_ratio >= 0 && inc_ratio < 0.1 || inc_ratio <= 0 && inc_ratio > -0.1) {
262					$(this).removeAttr('style');
263
264				// 縦長
265				} else if (cl_ratio > img_ratio) {
266					var t = (cl_w / img_w * img_h - cl_h) / 2 * -1;
267					if (t < 0) {
268						$(this).css({
269							width: '100%',
270							top: t
271						});
272					}
273
274				// 横長・正方形
275				} else {
276					var l = (cl_h / img_h * img_w - cl_w) / 2 * -1;
277					if (l < 0) {
278						$(this).css({
279							height: '100%',
280							left: l
281						});
282					}
283				}
284			});
285		};
286
287		// cssリセット
288		init_object_fit_cover($('.js-object-fit-cover img'));
289
290		// 画像読み込み時処理
291		$('.js-object-fit-cover img').load(function(){
292			fix_object_fit_cover(this);
293		}).each(function(){
294			if (this.complete || this.readyState === 4 || this.readyState === 'complete'){
295				fix_object_fit_cover(this);
296			}
297		});
298
299		var object_fit_cover_resize_timer;
300		$(window).on('resize', function(){
301			clearTimeout(object_fit_cover_resize_timer);
302			object_fit_cover_resize_timer = setTimeout(function(){
303				$('.js-object-fit-cover img').each(function(){
304					init_object_fit_cover(this);
305					fix_object_fit_cover(this);
306				});
307			}, 500);
308		});
309	}
310
311	/**
312	 * 初期化処理
313	 */
314	$(document).on('js-initialized', function(){
315		var is_responsive = $('body').hasClass('is-responsive');
316
317		// アーカイブスライダー
318		if ($('#js-archive-slider').length) {
319			$('#js-archive-slider').slick({
320				infinite: true,
321				dots: true,
322				arrows: false,
323				slidesToShow: 1,
324				slidesToScroll: 1,
325				adaptiveHeight: true,
326				autoplay: true,
327				speed: 1000,
328				autoplaySpeed: $('#js-archive-slider').attr('data-slide-time') || 7000
329			});
330		}
331
332		// フッタースライダー
333		if ($('#js-footer-slider').length) {
334			var slick_args = {
335				infinite: true,
336				dots: false,
337				arrows: true,
338				prevArrow: '<button type="button" class="slick-prev">&#xe90f;</button>',
339				nextArrow: '<button type="button" class="slick-next">&#xe910;</button>',
340				slidesToShow: 5,
341				slidesToScroll: 5,
342				adaptiveHeight: true,
343				autoplay: true,
344				speed: 1000,
345				autoplaySpeed: $('#js-footer-slider').attr('data-slide-time') || 7000
346			};
347
348			if (is_responsive) {
349				slick_args.responsive = [
350					{
351						breakpoint: 992,
352						settings: {
353							slidesToShow: 4,
354							slidesToScroll: 4
355						}
356					},
357					{
358						breakpoint: 768,
359						settings: {
360							slidesToShow: 3,
361							slidesToScroll: 3
362						}
363					},
364					{
365						breakpoint: 500,
366						settings: {
367							arrows: false,
368							slidesToShow: 2,
369							slidesToScroll: 2
370						}
371					}
372				];
373			}
374
375			$('#js-footer-slider').slick(slick_args);
376		}
377
378		// ページヘッダー
379		if ($('#js-page-header').length) {
380			$('#js-page-header').addClass('is-active');
381		}
382	});
383});

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.