PageSourceSearch

https://www.somatk.co.jp/wp-content/themes/template001/js/common.js?ver=a6304dae463b4394b0f88be15966a6b2

js somatk.co.jp collected 2026-10-06 08:17:48 UTC 5,398 bytes, 185 lines download raw bytes

1
2
3/* headerset008 */
4/*--------------------------------------------------*/
5
6(function($) {
7
8  /* アンカースクロールの際に考慮させたいヘッダー高 */
9  globalHeaderH_pc = 80; /* PC時 */
10  globalHeaderH_sp = 65; /* SP時 */
11  globalHeaderH_breakpoint = 992; /* PC時とSP時とが切り替わるブレイクポイント */
12
13  /* PC */
14  /*--------------------------------------------------*/
15
16  /* 現在ページのナビ項目をハイライト */
17
18  var url = location.href.normalizeURL();
19  $('.nav008-parent a').each(function() {
20    if ($(this).prop('href').normalizeURL() == url) {
21      $(this)
22      .closest('li').addClass('nav008-current')
23      .closest('.nav008-haschild').addClass('nav008-current');
24      return false;
25    }
26  });
27
28
29
30  /* SP */
31  /*--------------------------------------------------*/
32
33  var $nav008_hasdescendant = $('.nav008-haschild, .nav008-hasgrandchild');
34
35  /* ハンバーガー */
36  $('.nav008-hamburger, .nav008-overlay').on('click', function() {
37    $('html').toggleClass('nav008-opened');
38  });
39
40  /* スクロール → ハンバーガーの背景を白に */
41  $(window).on('scroll', function() {
42    var scrT = $(htmlorbody).scrollTop();
43    if ($('.header9999').outerHeight() < scrT) {
44      $('html').addClass('nav008-scrolled');
45    } else {
46      $('html').removeClass('nav008-scrolled');
47    }
48  });
49
50  /* アコーディオン */
51  $nav008_hasdescendant.find('> a').on('click',function(){
52    if (winW < 992) {
53      $(this).toggleClass('nav008-expanded')
54      .next('ul').slideToggle();
55    }
56  });
57
58  /* ウィンドウリサイズ → 992px以上 → スマホ時に非表示にした子孫を再表示 */
59  nav008_resize();
60  $(window).on('resize',function(){
61    nav008_resize();
62  });
63
64  function nav008_resize() {
65    if (winW < 992) {
66      /* 子孫持ちリンクをクリック不可にする */
67      $nav008_hasdescendant.find('> a[href]').on('click',nav008_preventDefault);
68    } else {
69      /* 子孫持ちリンクをクリック可能にする */
70      $nav008_hasdescendant.find('> a[href]').off('click',nav008_preventDefault);
71      /* 子孫を表示 */
72      $('.nav008-child, .nav008-grandchild').show();
73    }
74  }
75
76  function nav008_preventDefault(e) {
77    e.preventDefault();
78  }
79
80
81
82
83  /* Custom Post Type Widgetsのアーカイブリンクのバグ修正 */
84  /*--------------------------------------------------*/
85  var findSidebarAnchor = $('.widget_archive').find('a');
86  if($(findSidebarAnchor).length){
87    jQuery.each(findSidebarAnchor, function() {
88      var thisHref    = $(this).attr('href');
89      var thisUrlArr  = thisHref.split('/');
90      var newsSlug    = thisUrlArr[thisUrlArr.length-4];
91      var replaceHref = thisHref;
92      if(thisUrlArr[thisUrlArr.length-5]===newsSlug) {
93        replaceHref =  thisHref.replace(newsSlug + '/' + newsSlug , newsSlug);
94      }
95      $(this).attr('href', replaceHref);
96    });
97  }
98
99  /* アーカイブリストで件数表示がある時も崩れないように */
100  var widgetListClass = ['widget_archive','widget_categories'];
101  jQuery.each(widgetListClass, function(index,val) {
102    var findSidebarLi = $('.' + val).find('li');
103    if(findSidebarLi.length){
104      jQuery.each(findSidebarLi, function() {
105        var thisList       = $(this);
106        var thisAnchor     = thisList.find('a');
107        var thisAnchorHref = thisAnchor.attr('href');
108        var thisListText   = $(this).text();
109        // li要素を空にする
110        thisList.html('');
111        // a要素の内容をセット
112        thisAnchor.text(thisListText);
113        // li要素のaタグをセット
114        thisList.html(thisAnchor);
115      });
116    }
117  });
118
119
120
121    /* ドロップダウン形式のアーカイブリストでも崩れないように */
122  var findSidebarOption = $('select[name=archive-dropdown]').find('option');
123  if($(findSidebarOption).length){
124    jQuery.each(findSidebarOption, function() {
125      var thisHref    = $(this).attr('value');
126      var thisUrlArr  = thisHref.split('/');
127      var newsSlug    = thisUrlArr[thisUrlArr.length-4];
128      var replaceHref = thisHref;
129      if(thisUrlArr[thisUrlArr.length-5]===newsSlug) {
130        replaceHref =  thisHref.replace(newsSlug + '/' + newsSlug , newsSlug);
131      }
132      $(this).attr('value', replaceHref);
133    });
134  }
135
136  //tablet 横時 子ナビ表示
137	$('.ua-tablet .nav008-haschild, .ua-touch .nav008-haschild').on('click', function() {
138		$('.nav008-haschild').toggleClass('nav008-touch-open');
139	});
140
141  /* MW WP Form */
142  /*--------------------------------------------------*/
143  var inputTypes = ['text','password','checkbox','radio','file','hidden','submit','reset','button','image','tel','number'];
144  $.each(inputTypes, function(index, val) {
145    $( '.change-input-type-' + val ).each(function(index, el) {
146      $(this).attr('type',val);
147    });
148  });
149
150
151})(jQuery);
152
153
154
155
156
157/* pagetop170 */
158/*--------------------------------------------------*/
159
160(function($) {
161
162  var $pagetop170 = $('.pagetop170');
163
164  $(window).on('load scroll', function() {
165
166    var scrT = $(this).scrollTop();
167
168    if (scrT <= 200) {
169      $pagetop170.stop().fadeOut();
170    } else if (200 < scrT) {
171      $pagetop170.stop().fadeIn();
172    }
173
174  });
175
176  $pagetop170.on('click', function() {
177    $(htmlorbody).animate({
178      scrollTop: 0
179    }, {
180      duration: 500,
181      easing: 'easeOutQuart'
182    });
183  });
184
185})(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.