PageSourceSearch

https://www.kikoh-sports.com/hoshida/user/theme/hoshida/media/js/common.js

js kikoh-sports.com collected 2026-10-07 02:04:58 UTC 3,937 bytes, 146 lines download raw bytes

1var SP_FIXED = true;
2var SP_WIDTH = 769;
3var SPEED = 500;
4
5var TEL = '0728440077';
6var TEL2 = '0728440088';
7
8var UA = navigator.userAgent.toLowerCase();
9// iPhone
10var isiPhone = (UA.indexOf('iphone') > -1);
11// Android
12var isAndroid = (UA.indexOf('android') > -1) && (UA.indexOf('mobile') > -1);
13
14function scrollPosition(position) {
15  if ($(window).width() < SP_WIDTH) {
16    position -= SP_FIXED ? $('header').height() : 0;
17  }
18  $('html, body').animate({
19    scrollTop: position
20  }, SPEED);
21}
22
23//(<a href="#top">の様に記述すると滑らかにスクロールする。)
24$(function () {
25  $('a[href^="#"]').click(function () {
26    var position = $(this.hash).length > 0 ? $(this.hash).offset().top : 0;
27    scrollPosition(position);
28    return false;
29  });
30});
31
32$(function () {
33  $(document).on('ready', function() {
34    if ($(window).width() < SP_WIDTH) {
35    if (location.hash != "") {
36      var pos = $(location.hash).offset().top;
37      pos -= $('header').height();
38      $("html, body").animate({ scrollTop: pos }, 1, "swing");
39    }}
40  });
41});
42
43$(function () {
44  $('a[href*=".html#"]').on('click', function(){
45    if ($(this).parents().parents('ul').hasClass('m-nav') == true && window.location.pathname == $(this)[0].pathname) {
46      $(document.body).removeClass('open').removeAttr('style');
47      $('.menu-trigger').removeClass('active');
48      var position = $(this.hash).offset().top - $('header').height();
49      $('html, body').animate({
50        scrollTop: position
51      }, 1);
52      return false;
53    }
54  })
55});
56// 一定量スクロールするとページトップに戻るが表示される(場所等の指定はcommon.scssにて)
57$(function () {
58  var top_btn = $('.pagetop');
59  top_btn.hide();
60  $(window).scroll(function () {
61    $(this).scrollTop() > 100 ? top_btn.fadeIn() : top_btn.fadeOut();
62  });
63
64  top_btn.click(function () {
65    scrollPosition(0);
66    return false;
67  });
68});
69
70// rollover(_offと末尾についた画像をオンマウスで_onとついた画像に切り替える)
71$(function () {
72  $('img').hover(
73    function () {
74      $(this).attr('src', $(this).attr('src').replace('_off.', '_on.'));
75    },
76    function () {
77      $(this).attr('src', $(this).attr('src').replace('_on.', '_off.'));
78    }
79  );
80});
81
82//スマートフォン時のみ電話発信できる様にする(imgタグ用、imgタグに任意のclassを指定する。)
83$(function () {
84  var device = navigator.userAgent;
85  if (isiPhone || isAndroid) {
86    $(".tel").wrap('<a href="tel:'+TEL+'"></a>');
87    $(".tel2").wrap('<a href="tel:'+TEL2+'"></a>');
88  }
89});
90
91$(function () {
92  var menu_btn_wrap = $('.menu-btn-wrap01');
93	var menu_btn = $('.slidemenu-btn');
94  var body = $(document.body);
95  var top = 0;
96  var menu_open = false;
97
98  menu_btn_wrap.on('click', function () {
99    if (!menu_open) {
100      top = body.scrollTop();
101    }
102    body.toggleClass('open');
103    menu_btn.toggleClass('active');
104    menu_open = true;
105    if (body.hasClass('open')) {
106      body.css({
107        'height': window.innerHeight,
108        'top': -top
109      });
110    } else {
111      body.removeAttr('style').scrollTop(top);
112      menu_open = false;
113    }
114  });
115});
116
117// メニューボタンに.activeをつける
118$(document).ready(function() {
119	$('.menu-btn-wrap01').on('click', function() {
120		$('.menu-trigger').toggleClass('active');
121		return false;
122	});
123});
124
125// メニュー切り替え
126$(function(){   
127  $(".accordion dt").click(function(){
128    $(this).next("dd").slideToggle();
129    $(this).next("dd").siblings("dd").slideUp();
130    $(this).toggleClass("open");    
131    $(this).siblings("dt").removeClass("open");
132  });
133});
134
135
136//横幅375px以下のviewportの設定
137// new ViewportExtra(375)
138$(function () {
139  if ($(window).innerWidth() < 375) {
140    new ViewportExtra(375)
141    console.log("sp")
142  } else if ($(window).innerWidth() < 1350 && $(window).innerWidth() > 768) {
143    new ViewportExtra(1350)
144    console.log("pc")
145  }
146});

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.