PageSourceSearch

https://www.jsports.co.jp/js/modular-templates.js

js jsports.co.jp collected 2026-09-24 09:02:42 UTC 23,059 bytes, 727 lines download raw bytes

1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2//ページ内リンク
3jQuery(function($) {
4    $('a[href^="#"]').on('click', function(e) {
5        var targetId = $(this).attr('href');
6
7        if (!targetId || targetId === '#') {
8            return;
9        }
10        var $target = $(targetId);
11
12        if (
13            $target.length &&
14            ($target.hasClass('mod-mark-title01') ||
15                $target.hasClass('mod-team-title01') ||
16                $target.hasClass('section-title'))
17        ) {
18            e.preventDefault();
19
20            var headerHeight = $('header').outerHeight() || 0;
21            var extraMargin = (window.innerWidth < 768) ? 140 : 60;
22            var scrollPosition = $target.offset().top - headerHeight - extraMargin;
23
24            $('html, body').stop().animate(
25                { scrollTop: scrollPosition },
26                600,
27                'swing'
28            );
29        }
30    });
31});
32
33//アコーディオンのありなし
34$('.js-switch03-btn').each(function() {
35    if ($(this).find('.mod-game-accordion__arrow').length > 0) {
36        $(this).addClass('has-accordion'); // ←お好きなクラス名に
37    }
38});
39
40//サブメニューのFIXED
41$(function () {
42    var $nav = $(".mod-nav");
43    var navOffset = $nav.offset().top; // .mod-nav の元の位置
44
45    const earlyDetectionOffset = 100;
46
47    $(window).on("scroll", function () {
48        if ($(window).scrollTop() > navOffset - earlyDetectionOffset) {
49            $nav.addClass("is-fixed");
50        } else {
51            $nav.removeClass("is-fixed");
52        }
53    });
54});
55
56//カルーセル・・・動画
57$(document).ready(function(){
58    $('.mod-movie-slider').slick({
59        infinite: true,      // 無限ループ
60        slidesToShow: 1,     // 一度に見せる枚数
61        slidesToScroll: 1,   // スクロール時に動かす枚数
62        arrows: true,        // 矢印を表示
63        dots: true,          // ドットナビ表示
64        autoplaySpeed: 3000, // 自動再生速度(ミリ秒)
65        prevArrow: '<button type="button" class="slick-prev"></button>',
66        nextArrow: '<button type="button" class="slick-next"></button>',
67        responsive: [
68            {
69                breakpoint: 768,    // スマホ・タブレット用
70                settings: {
71                    slidesToShow: 1,
72                    slidesToScroll: 1,
73                    dots: true,
74                }
75            }
76        ]
77    });
78});
79
80//スライド・・・選手
81$(document).ready(function(){
82    $('.mod-member-slider').slick({
83        infinite: true,      // 無限ループ
84        slidesToShow: 1,     // 一度に見せる枚数
85        slidesToScroll: 1,   // スクロール時に動かす枚数
86        arrows: true,        // 矢印を表示
87        dots: true,          // ドットナビ表示
88        autoplay: true,           // 自動再生を有効に
89        autoplaySpeed: 5000,
90        prevArrow: '<button type="button" class="slick-prev"></button>',
91        nextArrow: '<button type="button" class="slick-next"></button>',
92        responsive: [
93            {
94                breakpoint: 768,    // スマホ・タブレット用
95                settings: {
96                    slidesToShow: 1,
97                    slidesToScroll: 1
98                }
99            }
100        ]
101    });
102});
103
104//初期表示崩れの解消
105
106
107$(function(){
108    var $slider = $('.mod-scroll-slider');
109    var slickOptions = {
110        infinite: false,
111        slidesToShow: 1,
112        variableWidth: true,
113        arrows: true,
114        dots: true,
115        swipe: true,
116        touchMove: true,
117        draggable: true,
118        touchThreshold: 5
119    };
120
121    var isSlickActive = false;
122
123    function initSlider() {
124        var winW = $(window).width();
125
126        if (winW > 1024) {
127            if (!isSlickActive) {
128                $slider.slick(slickOptions);
129                isSlickActive = true;
130            }
131        } else {
132            if (isSlickActive) {
133                $slider.slick('unslick');
134                isSlickActive = false;
135            }
136        }
137    }
138
139    // 初回
140    initSlider();
141
142    // リサイズ時
143    $(window).on('resize', function(){
144        initSlider();
145    });
146
147    // 遅延表示
148    /*
149    setTimeout(function(){mod-pageTitle-bg-type
150        $slider.css('visibility', 'visible');
151    }, 1000);
152
153     */
154});
155
156//コメントアコーディオン
157
158$(document).ready(function() {
159    const accordion = $('.accordion-comment');
160
161    function setAccordionHeights() {
162        accordion.each(function() {
163            const _accordion = $(this);
164            const content = _accordion.find('.accordion-comment__contents');
165            const btn = _accordion.find('.accordion-comment__btn');
166            const span = btn.find('span');
167
168            // 幅に応じて高さを設定
169            let collapsedHeight = $(window).width() < 768 ? 100 : 600;
170
171            const fullHeight = content.prop('scrollHeight');
172
173            // 開閉状態によって高さを決める
174            if (!_accordion.hasClass('is-open')) {
175                content.css('height', collapsedHeight + 'px').addClass('is-collapsed');
176                span.text('続きを読む');
177            } else {
178                content.css('height', fullHeight + 'px').removeClass('is-collapsed');
179                span.text('閉じる');
180            }
181
182            // PCでは常にボタン表示
183            if (fullHeight > collapsedHeight || $(window).width() >= 768) {
184                btn.show();
185            } else {
186                btn.hide();
187            }
188
189            // ボタンクリック処理
190            btn.off('click').on('click', function() {
191                if (content.hasClass('is-collapsed')) {
192                    content.css('height', fullHeight + 'px').removeClass('is-collapsed');
193                    span.text('閉じる');
194                    _accordion.addClass('is-open');
195                } else {
196                    content.css('height', collapsedHeight + 'px').addClass('is-collapsed');
197                    span.text('続きを読む');
198                    _accordion.removeClass('is-open');
199                }
200            });
201        });
202    }
203
204    // 初期設定
205    setAccordionHeights();
206
207    // 画面サイズ変更時に再設定(debounce推奨)
208    let resizeTimer;
209    $(window).on('resize', function() {
210        clearTimeout(resizeTimer);
211        resizeTimer = setTimeout(function() {
212            setAccordionHeights();
213        }, 200);
214    });
215});
216
217
218
219//switch(アコーディオン)
220/*
221jQuery(function ($) {
222    var $switchBtn = $(".js-switch-btn");
223    // 初期状態の同期
224    $(".js-switch").each(function () {
225        var $contents = $(this).find(".js-switch-contents");
226        if ($(this).hasClass("open") || $(this).hasClass("active")) {
227            $(this).addClass("active");
228            $contents.stop(true, true).css('display', 'block');
229        } else {
230            $contents.stop(true, true).css('display', 'none');
231        }
232    });
233    // クリック
234    $switchBtn.on('click', function (e) {
235        e.preventDefault();
236        e.stopPropagation();
237
238        var $parent = $(this).parents(".js-switch");
239        var $contents = $parent.find(".js-switch-contents");
240
241        // 進行中のアニメーションをキャンセルし、現在の状態に揃える
242        $contents.stop(true, true);
243
244        if ($parent.hasClass("active")) {
245            // 閉じる(スライド)
246            $parent.removeClass("active");
247            // display:block のままslideUpに渡すと確実にアニメ
248            if ($contents.css('display') === 'none') $contents.css('display', 'block');
249            $contents.slideUp(250);
250        } else {
251            // 開く(スライド)
252            $parent.addClass("active");
253            // 先にdisplay:blockにしてからslideDown
254            if ($contents.css('display') === 'none') $contents.css('display', 'block').hide();
255            $contents.slideDown(250);
256        }
257    });
258});
259
260
261 */
262//switch(アコーディオン)
263jQuery(function ($) {
264    var $switchBtn = $(".js-switch-btn");
265
266    // 初期同期:open がある親は active を付与
267    $(".js-switch").each(function () {
268        var $wrap = $(this);
269        if ($wrap.hasClass("open")) {
270            $wrap.addClass("active");
271        }
272    });
273
274    $switchBtn.click(function () {
275        // 直近の .js-switch のみを対象
276        var $wrap = $(this).parents(".js-switch").first();
277
278        // active をトグル(open の有無は初期化時のみ参照)
279        $wrap.toggleClass("active");
280
281        // ...表示/非表示はCSSで .active に紐づける想定...
282    });
283});
284
285
286//番組スライド
287$('.mod-program-slider').slick({
288    slidesToShow: 3,
289    centerMode: true,
290    centerPadding: '40px',
291    arrows: false,
292    dots: true,
293    autoplay: true,           // 自動再生を有効に
294    autoplaySpeed: 5000,
295    responsive: [
296        {
297            breakpoint: 768, // 768px以下のとき
298            settings: {
299                slidesToShow: 1,
300                centerMode: true,
301                centerPadding: '20px',
302                arrows:true,
303                prevArrow: '<button type="button" class="slick-prev"></button>',
304                nextArrow: '<button type="button" class="slick-next"></button>',
305            }
306        }
307    ]
308});
309
310//バナースライド
311$('.mod-bnr-slide').slick({
312    slidesToScroll: 1,
313    slidesToShow: 3,
314    infinite: true,         // ← true に
315    variableWidth: true,
316    arrows: false,
317    dots: true,
318    centerMode: true,      // variableWidthと併用時はfalse推奨
319    focusOnSelect: true,
320    centerPadding: '40px',
321    autoplay: true,
322    autoplaySpeed: 5000,
323});
324
325//モーダルのヘッダー処理
326$(document).on('opening', '.remodal', function () {
327    $('.header.hide').removeClass('hide');
328});
329
330
331jQuery(function ($) {
332    var $switchBtn = $(".js-switch02-btn");
333
334    // 初期状態の同期
335    $(".js-switch02").each(function () {
336        var $contents = $(this).find(".js-switch02-contents");
337        // "open" クラスがあれば最初から開く
338        if ($(this).hasClass("active") || $(this).hasClass("open")) {
339            $contents.show();
340        } else {
341            $contents.hide();
342        }
343    });
344
345    // クリック処理
346    $switchBtn.click(function () {
347        var $parent = $(this).parents(".js-switch02");
348        $parent.toggleClass("active")
349            .find(".js-switch02-contents")
350            .slideToggle(400);
351    });
352});
353jQuery(function ($) {
354    var $switchBtn = $(".js-switch03-btn");
355
356    // 初期状態の同期
357    $(".js-switch03").each(function () {
358        var $contents = $(this).find(".js-switch03-contents");
359        if ($(this).hasClass("open")) {
360            $contents.show();  // open が付いているものは最初から開く
361        } else {
362            $contents.hide();  // それ以外は閉じた状態
363        }
364    });
365
366    // クリック処理
367    $switchBtn.click(function () {
368        var $contents = $(this).parents(".js-switch03");
369        $contents.toggleClass("open")
370            .find(".js-switch03-contents")
371            .slideToggle(400);
372    });
373});
374//続きアコーディオン
375$(document).ready(function () {
376    const contents = $(".js-sv-accordion__contents");
377    const moreButtons = $(".js-sv-accordion__more");
378    const breakpoints = {
379        tab: 1100,
380    };
381
382    let windowWidth = $(window).width();
383    let previousBreakpoint = windowWidth < breakpoints.tab ? "mobile" : "desktop";
384
385    function debounce(func, wait) {
386        let timeout;
387        return function () {
388            const context = this;
389            const args = arguments;
390            clearTimeout(timeout);
391            timeout = setTimeout(() =>
391 func.apply(context, args), wait);
392        };
393    }
394
395    function initializeAccordion() {
396        contents.each(function () {
397            const $this = $(this);
398            const itemCount = $this.children("li").length;
399
400            $this.css("height", "auto"); // 一旦リセット
401
402            const isMobile = windowWidth < breakpoints.tab;
403
404            if ((isMobile && itemCount < 5) || (!isMobile && itemCount < 15)) {
405                $this.next('.js-sv-accordion__more').hide();
406                $this.removeClass('is-hide').css("height", "auto");
407            } else {
408                const collapsedHeight = isMobile ? 850 : 1000;
409                $this.css("height", collapsedHeight + "px").addClass("is-hide");
410                $this.next('.js-sv-accordion__more').show();
411            }
412        });
413    }
414
415    initializeAccordion();
416
417    $(".js-sv-accordion__more").on("click", function () {
418        const $button = $(this);
419        const $content = $button.prev(".js-sv-accordion__contents");
420
421        if (!$button.hasClass("is-show")) {
422            const fullHeight = $content.prop("scrollHeight");
423            $button.addClass("is-show").text("");
424            $content.animate({ height: fullHeight }, 200).removeClass("is-hide");
425        } else {
426            const itemCount = $content.children("li").length;
427            const isMobile = windowWidth < breakpoints.tab;
428            const collapsedHeight = isMobile ? 850 : 1000;
429
430            $button.removeClass("is-show").text("");
431            $content.animate({ height: collapsedHeight }, 200).addClass("is-hide");
432        }
433    });
434
435    $(window).on(
436        "resize",
437        debounce(function () {
438            const newWidth = $(window).width();
439            const newBreakpoint = newWidth < breakpoints.tab ? "mobile" : "desktop";
440
441            if (newBreakpoint !== previousBreakpoint) {
442                windowWidth = newWidth;
443                previousBreakpoint = newBreakpoint;
444
445                initializeAccordion();
446
447                // 折りたたみボタンのリセット
448                moreButtons.each(function () {
449                    const $button = $(this);
450                    const $content = $button.prev(".js-sv-accordion__contents");
451
452                    $button.removeClass("is-show").text("");
453                    const itemCount = $content.children("li").length;
454                    const collapsedHeight = windowWidth < breakpoints.tab ? 850 : 1000;
455
456                    if ($content.hasClass("is-hide")) {
457                        $content.animate({ height: collapsedHeight }, 200);
458                    }
459                });
460            }
461        }, 250)
462    );
463});
464
465//続きアコーディオン02
466$(document).ready(function () {
467    const containers = $(".js-sv-accordion2__contents");
468    const moreButtons = $(".js-sv-accordion2__more");
469    const breakpoints = {
470        tab: 1100,
471    };
472
473    let windowWidth = $(window).width();
474    let previousBreakpoint = windowWidth < breakpoints.tab ? "mobile" : "desktop";
475
476    function debounce(func, wait) {
477        let timeout;
478        return function () {
479            const context = this;
480            const args = arguments;
481            clearTimeout(timeout);
482            timeout = setTimeout(() => func.apply(context, args), wait);
483        };
484    }
485
486    function initializeAccordion() {
487        containers.each(function () {
488            const $container = $(this);
489            const $items = $container.children("li");
490            const itemCount = $items.length;
491
492            const isMobile = windowWidth < breakpoints.tab;
493            const visibleCount = isMobile ? 4 : 16;
494
495            $items.removeClass("is-hidden"); // 一度リセット
496
497            if (itemCount > visibleCount) {
498                $items.slice(visibleCount).addClass("is-hidden");
499                $container.addClass("is-hide"); // ★追加:隠すとき is-hide を追加
500                $container.next(".js-sv-accordion2__more").show().removeClass("is-show").text("");
501            } else {
502                $container.removeClass("is-hide"); // ★追加:表示時は is-hide 削除
503                $container.next(".js-sv-accordion2__more").hide();
504            }
505        });
506    }
507
508    initializeAccordion();
509
510    $(".js-sv-accordion2__more").on("click", function () {
511        const $btn = $(this);
512        const $container = $btn.prev(".js-sv-accordion2__contents");
513        const $items = $container.children("li");
514
515        if (!$btn.hasClass("is-show")) {
516            // すべて表示
517            $items.removeClass("is-hidden");
518            $container.removeClass("is-hide"); // ★ is-hide 削除
519            $btn.addClass("is-show").text("");
520        } else {
521            // 再び一部だけ表示
522            const isMobile = windowWidth < breakpoints.tab;
523            const visibleCount = isMobile ? 4 : 16;
524
525            $items.removeClass("is-hidden").slice(visibleCount).addClass("is-hidden");
526            $container.addClass("is-hide"); // ★ is-hide 追加
527            $btn.removeClass("is-show").text("");
528        }
529    });
530
531    $(window).on(
532        "resize",
533        debounce(function () {
534            const newWidth = $(window).width();
535            const newBreakpoint = newWidth < breakpoints.tab ? "mobile" : "desktop";
536
537            if (newBreakpoint !== previousBreakpoint) {
538                windowWidth = newWidth;
539                previousBreakpoint = newBreakpoint;
540                initializeAccordion();
541            }
542        }, 250)
543    );
544});
545
546//タブ切り替え
547$(function () {
548    $('.mod-tab-box01').each(function () {
549        const $wrap = $(this);
550        $wrap.find('.mod-tab-btn').on('click', function () {
551            const index = Number($(this).data('index')) || 0;
552            const $items = $wrap.find('.mod-tab-box01__contents .mod-tab-box01__item');
553            $items.removeClass('is-active').eq(index).addClass('is-active');
554            $wrap.find('.mod-tab-btn').removeClass('is-active');
555            $(this).addClass('is-active');
556        });
557    });
558});
559//モーダル対応、URL削除
560$(document).on('opening', '.remodal', function () {
561    history.replaceState(null, null, ' '); // ハッシュ消去
562});
563
564
565//
566jQuery(function($){
567    // 初期表示:currentクラスの月のみ表示
568    var $current = $('.mod-scroll-nav__link.current');
569    var month = $current.data('month');
570    $('.mod-month-contents').hide();
571    $('.mod-month-contents[data-month="' + month + '"]').show();
572
573    // クリック時の切り替え
574    $('.mod-scroll-nav__link').on('click', function(e){
575        e.preventDefault();
576        var month = $(this).data('month');
577        $('.mod-month-contents').hide();
578        $('.mod-month-contents[data-month="' + month + '"]').show();
579        $('.mod-scroll-nav__link').removeClass('current');
580        $(this).addClass('current');
581    });
582});
583
584// 続きを読む(アコーディオン)
585jQuery(function ($) {
586    let itemHeights = [];
587    const options = {
588        breakpoints: {
589            pc_contents: 1100,
590            pc: 1024,
591            tab: 768,
592            sp: 767
593        }
594    };
595
596    const getWindowWidth = () => $(window).width();
597
598    const debounce = (func, wait) => {
599        let timeout;
600        return (...args) => {
601            clearTimeout(timeout);
602            timeout = setTimeout(() => func(...args), wait);
603        };
604    };
605
606    // アコーディオンのセットアップ
607    const setupAccordion = () => {
608        const contents = $('.js-mod-accordion__contents');
609        itemHeights = [];
610        contents.each((_, element) => {
611            const $this = $(element);
612            const thisHeight = $this.height();
613            itemHeights.push(thisHeight);
614            $this.addClass('is-hide');
615        });
616
617        setInitialHeight(contents);
618
619        setupClickEvents();
620    };
621
622    const setInitialHeight = (contents) => {
623        if (contents.parent().hasClass('top')) {
624            contents.height(100);
625        } else if (getWindowWidth() < options.breakpoints.tab) {
626            contents.height(100);
627        } else {
628            contents.height(100);
629        }
630    };
631
632    const setupClickEvents = () => {
633        $('.js-mod-accordion__more').off('click.modAccordion');
634        $('.js-mod-accordion__more').on('click.modAccordion', handleAccordionClick);
635    };
636
637    const handleAccordionClick = (event) => {
638        const $this = $(event.currentTarget);
639        let infoHeight = 100;
640        const $contents = $('.js-mod-accordion__contents');
641        if ($this.parent().hasClass('w-info__text') &&
642            getWindowWidth() < options.breakpoints.tab &&
643            !$contents.parent().hasClass('top')) {
644            infoHeight = 100;
645        }
646
647        if (!$this.hasClass('is-show')) {
648            expandAccordion($this);
649        } else {
650            collapseAccordion($this, infoHeight);
651        }
652    };
653
654    const expandAccordion = ($button) => {
655        const index = $button.index('.js-mod-accordion__more');
656        const targetHeight = itemHeights[index];
657
658        if (targetHeight) {
659            $button.addClass('is-show')
660                .prev()
661                .animate({ height: targetHeight }, 200)
662                .removeClass('is-hide');
663        }
664    };
665
666    const collapseAccordion = ($button, infoHeight) => {
667        $button.removeClass('is-show')
668            .prev()
669            .animate({ height: infoHeight }, 200)
670            .addClass('is-hide');
671    };
672
673    const reinitializeAccordion = () => {
674        $('.js-mod-accordion__more.is-show').each((_, element) => {
675            const $this = $(element);
676            $this.removeClass('is-show')
677                .prev()
678                .addClass('is-hide');
679        });
680
681        setupAccordion();
682    };
683
684    const init = () => {
685        if (document.readyState === 'loading') {
686            document.addEventListener('DOMContentLoaded', setupAccordion);
687        } else {
688            setupAccordion();
689        }
690
691        $(window).on('resize', debounce(reinitializeAccordion, 250));
692    };
693
694    init();
695
696});
697
698
699//カルーセルのセンター寄せ
700document.addEventListener('DOMContentLoaded', () => {
701    const grids = document.querySelectorAll('.card__team-grid');
702
703    if (!grids.length) {
704        //console.log('card__team-grid が見つかりません');
705        return;
706    }
707
708    console.log(`gridの数: ${grids.length}`);
709
710    grids.forEach((grid, i) => {
711        const items = grid.querySelectorAll('.card__team-item');
712        //console.log(`Grid ${i + 1} の item 数: ${items.length}`);
713
714        if (items.length <= 3) {
715            grid.classList.add('is-centered');
716           // console.log(`→ Grid ${i + 1} に is-centered を付与`);
717        } else {
718            //console.log(`→ Grid ${i + 1} はそのまま`);
719        }
720    });
721});
722
723
724
725
726
727},{}]},{},[1]);

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.