PageSourceSearch

https://job.career-tasu.jp/shared/js/home/top-recommend-swiper.js

js career-tasu.jp collected 2026-09-24 09:51:27 UTC 1,782 bytes, 53 lines download raw bytes

1/*
2  トップ画面用レコメンドのスライダー設定
3*/
4$(document).ready(function () {
5  $(".c_swiperSlider").each(function () {
6    var $swiperElement = $(this).find(".swiper");
7    var swiperInstance = $swiperElement[0]?.swiper;
8
9    // カスタムスライド動作の追加
10    var $nextButton = $(this).find(".swiper-button-next");
11    var $prevButton = $(this).find(".swiper-button-prev");
12
13    // クラスに応じたスライド数を決定
14    function getSlideStep($element) {
15      if ($element.closest(".c_swiperSlider").hasClass("c_swiperSlider--col6-3")) {
16        return 5; // col6-3の場合は5件スライド
17      } else if ($element.closest(".c_swiperSlider").hasClass("c_swiperSlider--col3-1")) {
18        return 3; // col3-1の場合は3件スライド
19      }
20      return 1; // デフォルトは1件
21    }
22
23    // 次へボタンのカスタム動作
24    $nextButton.on("click", function(e) {
25      e.preventDefault();
26
27      var slideStep = getSlideStep($(this));
28      var nextIndex = swiperInstance.activeIndex + slideStep;
29
30      // 終端を超えないようにチェック
31      if (nextIndex < swiperInstance.slides.length) {
32        swiperInstance.slideTo(nextIndex);
33      } else {
34        swiperInstance.slideTo(swiperInstance.slides.length - 1); // 最後のスライド
35      }
36    });
37
38    // 前へボタンのカスタム動作
39    $prevButton.on("click", function(e) {
40      e.preventDefault();
41
42      var slideStep = getSlideStep($(this));
43      var prevIndex = swiperInstance.activeIndex - slideStep;
44
45      // 始端を超えないようにチェック
46      if (prevIndex >= 0) {
47        swiperInstance.slideTo(prevIndex);
48      } else {
49        swiperInstance.slideTo(0); // 最初のスライド
50      }
51    });
52  });
53});

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.