PageSourceSearch

https://www.nig.ac.jp/wp/wp-content/themes/nig/js/home.js?ver=1.0.0

js nig.ac.jp collected 2026-09-24 08:40:24 UTC 3,317 bytes, 101 lines download raw bytes

1"use strict";
2(function ($) {
3  // ==========================================================================
4  // トップスライダー設定
5  // ==========================================================================
6  const topSlider = function () {
7    // Swiperだと非アクティブタブ時にCSSのフェードアニメーションと同期がずれるので下記URLの方法で実装
8    // https://allabout.co.jp/gm/gc/417216/2/
9    const slide = '.tm_slide-container';
10    function slideSwitch() {
11      let active = $(slide).find('.slider-slide.active');
12      if (active.length == 0) active = $(slide).find('.slider-slide:last-of-type');
13      const next = active.next().length ? active.next() : $(slide).find('.slider-slide:first-of-type');
14      active.addClass('last-active');
15      next.css({ opacity: 0.0 }).addClass('active').animate({ opacity: 1.0 }, 1000, function () {
16        active.removeClass('active last-active');
17      });
18    }
19    $(window).on('load', function () {
20      setInterval(slideSwitch, 8000);
21    });
22  };
23  const researchSlider = function () {
24    $(window).on('load', function () {
25      const research_swiper = new Swiper('.research_swiper-container', {
26        slidesPerView: 'auto',
27        spaceBetween: 24,
28        loop: false,
29        speed: 1000,
30        watchOverflow: true,
31        scrollbar: {
32          el: ".swiper-scrollbar",
33          draggable: true,
34          hide: false,
35        },
36        navigation: {
37          nextEl: '.swiper-button-next',
38          prevEl: '.swiper-button-prev',
39        },
40        breakpoints: {
41          1000: {
42            spaceBetween: 32
43          },
44        },
45      });
46      const minH = $('.top_research-01 .main .list').height();
47      $('.top_research-01 .main').css('min-height', minH);
48    });
49  };
50  const scientistsSlider = function () {
51    const slide = '.scientists_swiper-container';
52    if ($(slide).find('.swiper-slide').length < 2) {
53      $(slide).addClass('_1col');
54    } else if ($(slide).find('.swiper-slide').length < 5) {
55      $(slide).addClass('_4col');
56    }
57    $(window).on('load', function () {
58      const scientists_swiper = new Swiper(slide, {
59        slidesPerView: 'auto',
60        spaceBetween: 16,
61        loop: true,
62        speed: 1000,
63        watchOverflow: true,
64        centeredSlides : true,
65        autoplay: {
66          delay: 2000,
67          disableOnInteraction: false
68        },
69        navigation: {
70          nextEl: '.swiper-button-next',
71          prevEl: '.swiper-button-prev',
72        },
73        breakpoints: {
74          1000: {
75            spaceBetween: 32,
76          },
77        },
78      });
79    });
80  };
81
82  // ==========================================================================
83  // タブ切り替え設定 https://gist.github.com/sakunyo/4538094
84  // ==========================================================================
85  const dualTabSetting = function () {
86    $('.module_tab-01').dualTab({
87      selected: '_current',
88      menus: 'li',
89      body: '.module_tab-body'
90    });
91  };
92
93  // ==========================================================================
94  // 実行
95  // ==========================================================================
96  topSlider();
97  researchSlider();
98  scientistsSlider();
99  dualTabSetting();
100
101})(jQuery);

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.