PageSourceSearch

https://enechange.co.jp/shared/js/sustainability.js

js enechange.co.jp collected 2026-09-24 18:59:06 UTC 1,820 bytes, 77 lines download raw bytes

1$(document).ready(function () {
2  //imgChange
3  var srcArr = [];
4  var nowDevice = "pc";
5  $(".js_imgChange").each(function (idx) {
6    var obj = {
7      pcSrc: $(this).attr("src"),
8      spSrc: $(this).data("spsrc"),
9    };
10    srcArr.push(obj);
11  });
12  function getDevice() {
13    if (window.matchMedia("(min-width: 768px)").matches) {
14      return "pc";
15    } else {
16      return "sp";
17    }
18  }
19  function imgChange() {
20    if (getDevice() !== nowDevice) {
21      if (getDevice() === "pc") {
22        $(".js_imgChange").each(function (idx) {
23          $(this).attr("src", srcArr[idx].pcSrc);
24        });
25      } else {
26        $(".js_imgChange").each(function (idx) {
27          $(this).attr("src", srcArr[idx].spSrc);
28        });
29      }
30      nowDevice = getDevice();
31    }
32  }
33  imgChange();
34  $(function () {
35    var resizeTimer = null;
36    $(window).on("resize", function () {
37      clearTimeout(resizeTimer);
38      resizeTimer = setTimeout(function () {
39        imgChange();
40      }, 200);
41    });
42  });
43
44  // navfixed
45
46  if ($(".hero").length) {
47    $(window).scroll(function () {
48      var start;
49      if (window.matchMedia("(min-width: 1051px)").matches) {
50        start = 235;
51      } //else {
52      //start = 102;
53      //}
54
55      if ($(window).scrollTop() > start) {
56        $(".hero").addClass("is-fixed");
57      } else {
58        $(".hero").removeClass("is-fixed");
59      }
60    });
61  }
62
63  if ($(".hero__nav").length) {
64    var current = $(".hero__item.is-active").text();
65    $(".hero-nav-sp__current").html(current);
66
67    $(".hero-nav-sp__current").on("click", function () {
68      $(".hero__list").slideToggle();
69    });
70  }
71
72  if ($(".office-slider").length) {
73    $(".office-slider").slick({
74      dots: true,
75    });
76  }
77});

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.