PageSourceSearch

https://mizu-support-mirror.vercel.app/wp/wp-content/themes/mizu-support/js/common.js

js mizu-support-mirror.vercel.app collected 2026-10-03 07:19:23 UTC 5,383 bytes, 195 lines download raw bytes

1jQuery(function ($) {
2  /* スムーズスクロール */
3  // $('a[href^="#"]').click(function () {
4  //   var speed = 500;
5  //   var href = $(this).attr("href");
6  //   var target = $(href == "#" || href == "" ? 'html' : href);
7  //   var position = target.offset().top;
8  //   $('body,html').animate({ scrollTop: position }, speed, 'swing');
9  //   return false;
10  // });
11
12  /* PAGE TOP ある程度スクロールしてから出現 */
13  var topBtn = $('#gototop');
14  topBtn.hide();
15  $(window).scroll(function () {
16    if ($(this).scrollTop() > 200) {
17      topBtn.fadeIn();
18      $('.fix_footer').fadeIn();
19    } else {
20      topBtn.fadeOut();
21      $('.fix_footer').fadeOut();
22    }
23  });
24  
25  $(".f_nav ul.a").append($(".h_nav ul.a li").clone());
26  $(".f_nav ul.b").append($(".h_nav ul.b li").clone());
27  $(".f_nav ul.c").append($(".h_nav ul.c li").clone());
28  $(".f_nav ul.d").append($(".h_nav ul.d li").clone());
29  $(".h_nav_wrap .h_nav ul.a").append($(".f_nav ul.a li").clone());
30  $(".h_nav_wrap .h_nav ul.b").append($(".f_nav ul.b li").clone());
31  $(".h_nav_wrap .h_nav ul.c").append($(".f_nav ul.c li").clone());
32  $(".h_nav_wrap .h_nav ul.d").append($(".f_nav ul.d li").clone());
33  $(".f_nav ul.a li").eq(0).hide();
34  $(".f_nav ul.b li").eq(0).hide();
35  $(".f_nav ul.c li").eq(0).hide();
36  $(".f_nav ul.d li").eq(0).hide();
37  $(".f_nav_sp").append($(".h_nav_sp > *").clone());
38
39  /* スマホ用メニューが長い場合の処理 */
40  function resetMenu() {
41    if (isPc()) {
42      $('.h_sp_inner').css('height', 'auto');
43    }
44    else {
45      var wh = window.innerHeight ? window.innerHeight : $(window).height();
46      $('.h_sp_inner').height(wh - $('#header').outerHeight());
47    }
48  }
49  $(document).ready(resetMenu);
50  $(window).on("resize", resetMenu);
51
52  $('.perm_tab a').click(function () {
53    if ($(this).hasClass('active')) {
54      return false;
55    }
56    $('.perm_tab a').removeClass('active');
57    $('.perm_box > div').hide();
58    $('#' + $(this).attr('href')).fadeIn();
59    $(this).addClass('active');
60    return false;
61  });
62
63  $('.biz_case .tab a').click(function () {
64    if ($(this).hasClass('active')) {
65      return false;
66    }
67    $('.biz_case .tab a').removeClass('active');
68    $('.biz_case .box li').hide();
69    $('#' + $(this).attr('href')).fadeIn();
70    $(this).addClass('active');
71    return false;
72  });
73
74  $('.h_nav p').click(function () {
75    if ($(this).hasClass('open')) {
76      $(this).removeClass('open');
77    }
78    else {
79      $(this).addClass('open');
80    }
81  });
82
83  /* メニュー toggle */
84  $('.h_menu, .h_close').click(function () {
85    if ($('body').hasClass('open')) {
86      $('body').removeClass('open');
87      $('#toggle_menu').fadeOut();
88    }
89    else {
90      $('body').addClass('open');
91      $('#toggle_menu').fadeIn();
92    }
93    return false;
94  });
95
96  function heightLine(list, col, add) {
97    list.each(function () {
98      $(this).css('height', 'auto');
99    });
100    for (k = 0; k < (list.length / col) + 1; k++) {
101      var start = k * col;
102      var last = start + col;
103      if (last > list.length) {
104        last = list.length;
105      }
106      var maxHeight = 0;
107      for (i = start; i < last; i++) {
108        var height = list.eq(i).outerHeight();
109        if (height > maxHeight) {
110          maxHeight = height;
111        }
112      }
113      for (i = start; i < last; i++) {
114        list.eq(i).css('height', (maxHeight + add) + 'px');
115      }
116    }
117  }
118  function setListHeight() {
119    var list = $('.c_list.a > *');
120    if (list.length > 0) {
121      if (isPc()) {
122        heightLine(list, 4, 0);
123      }
124      else {
125        heightLine(list, 2, 0);
126      }
127    }
128    list = $('.c_list.b > *');
129    if (list.length > 0) {
130      if (isPc()) {
131        heightLine(list, 3, 0);
132      }
133      else {
134        heightLine(list, 2, 0);
135      }
136    }
137  }
138  $(document).ready(setListHeight);
139  $(window).resize(setListHeight);
140  setTimeout(setListHeight, 500)
141});
142
143/* PC/スマホ 画像切り替え */
144function switchImage() {
145  var width = $(window).width();
146  $('.u_switch_img').each(function (index) {
147    if (!$(this).attr('src')) return;
148    var src = $(this).attr('src');
149    var index = src.lastIndexOf('.');
150    var path = src.substring(0, index);
151    var ext = src.substring(index);
152    if (path.substring(index - 3) == '_sp') {
153      path = path.substring(0, index - 3);
154    }
155    if (isPc()) {
156      path = path + ext;
157    }
158    else {
159      path = path + "_sp" + ext;
160    }
161    if (src != path) {
162      $(this).attr("src", path);
163    }
164  });
165}
166
167function setView() {
168  var w = $(window).width();
169  if (w > $max) {
170    $('html').css('font-size', "62.5%");
171  }
172  else if (isPc()) {
173    $('html').css('font-size', (w / ($max / 62.5)) + "%");
174  }
175  else if (w > $min) {
176    $('html').css('font-size', "62.5%");
177  }
178  else {
179    $('html').css('font-size', (w / ($min / 62.5)) + "%");
180  }
181  switchImage();
182}
183
184function isPc() {
185  return $('.u_visible_sp').css('display') == 'none';
186}
187
188$(document).ready(function () {
189  $('body').append('<div class="u_visible_sp"></div><div id="max"></div><div id="min"></div>');
190  $max = $('#max').width();
191  $min = $('#min').width();
192});
193
194$(document).ready(setView);
195$(window).resize(setView);

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.