PageSourceSearch

https://www.sanrikutetsudou.com/wp-content/themes/santetsu/js/jscript.js?ver=2.3

js sanrikutetsudou.com collected 2026-09-24 20:28:15 UTC 11,603 bytes, 380 lines download raw bytes

1jQuery(document).ready(function($){
2
3  var $window = $(window);
4
5  $("a").bind("focus",function(){if(this.blur)this.blur();});
6  $("a.target_blank").attr("target","_blank");
7
8  // mega menu -------------------------------------------------
9
10  // mega menu post list animation
11  $(document).on({mouseenter : function(){
12    $(this).parent().siblings().removeClass('active')
13    $(this).parent().addClass('active');
14    var $content_id = "." + $(this).attr('data-cat-id');
15    $(".megamenu_blog_list .post_list").hide();
16    $($content_id).show();
17    return false;
18  }}, '.megamenu_blog_list .category_list a');
19
20  // mega menu basic animation
21  $('[data-megamenu]').each(function() {
22
23    var mega_menu_button = $(this);
24    var sub_menu_wrap =  "#" + $(this).data("megamenu");
25    var hide_sub_menu_timer;
26    var hide_sub_menu_interval = function() {
27      if (hide_sub_menu_timer) {
28        clearInterval(hide_sub_menu_timer);
29        hide_sub_menu_timer = null;
30      }
31      hide_sub_menu_timer = setInterval(function() {
32        if (!$(mega_menu_button).is(':hover') && !$(sub_menu_wrap).is(':hover')) {
33          $(sub_menu_wrap).stop().css('z-index','100').removeClass('active_mega_menu');
34          clearInterval(hide_sub_menu_timer);
35          hide_sub_menu_timer = null;
36        }
37      }, 20);
38    };
39
40    mega_menu_button.hover(
41     function(){
42       if (hide_sub_menu_timer) {
43         clearInterval(hide_sub_menu_timer);
44         hide_sub_menu_timer = null;
45       }
46       if ($('html').hasClass('pc')) {
47         $('#header').addClass('active');
48         $(this).parent().addClass('active_megamenu_button');
49         $(this).parent().find("ul").addClass('megamenu_child_menu');
50         $(sub_menu_wrap).stop().css('z-index','200').addClass('active_mega_menu');
51         if( $('.megamenu_blog_slider').length ){
52           $('.megamenu_blog_slider').slick('setPosition');
53         };
54       }
55     },
56     function(){
57       if ($('html').hasClass('pc')) {
58         if (!$('#header').hasClass('fix_active')) {
59           $('#header').removeClass('active');
60         }
61         $(this).parent().removeClass('active_megamenu_button');
62         $(this).parent().find("ul").removeClass('megamenu_child_menu');
63         hide_sub_menu_interval();
64       }
65     }
66    );
67
68    $(sub_menu_wrap).hover(
69      function(){
70        $('#header').addClass('active');
71        $(mega_menu_button).parent().addClass('active_megamenu_button');
72      },
73      function(){
74        if (!$('#header').hasClass('fix_active')) {
75          $('#header').removeClass('active');
76        }
77        $(mega_menu_button).parent().removeClass('active_megamenu_button');
78      }
79    );
80
81
82    $('#header').on('mouseout', sub_menu_wrap, function(){
83     if ($('html').hasClass('pc')) {
84       hide_sub_menu_interval();
85     }
86    });
87
88  }); // end mega menu
89
90
91  //return top button
92  var return_top_button = $('#return_top');
93  $('a',return_top_button).click(function() {
94    var myHref= $(this).attr("href");
95    var myPos = $(myHref).offset().top;
96    $("html,body").animate({scrollTop : myPos}, 1000, 'easeOutExpo');
97    return false;
98  });
99  return_top_button.removeClass('active');
100  $window.scroll(function () {
101    if ($(this).scrollTop() > 100) {
102      return_top_button.addClass('active');
103    } else {
104      return_top_button.removeClass('active');
105    }
106  });
107
108
109  //fixed footer content
110  var fixedFooter = $('#fixed_footer_content');
111  fixedFooter.removeClass('active');
112  $window.scroll(function () {
113    if ($(this).scrollTop() > 330) {
114      fixedFooter.addClass('active');
115    } else {
116      fixedFooter.removeClass('active');
117    }
118  });
119  $('#fixed_footer_content .close').click(function() {
120    $("#fixed_footer_content").hide();
121    return false;
122  });
123
124
125  // comment button
126  $("#comment_tab li").click(function() {
127    $("#comment_tab li").removeClass('active');
128    $(this).addClass("active");
129    $(".tab_contents").hide();
130    var selected_tab = $(this).find("a").attr("href");
131    $(selected_tab).fadeIn();
132    return false;
133  });
134
135
136  //custom drop menu widget
137  $(".tcdw_custom_drop_menu li:has(ul)").addClass('parent_menu');
138  $(".tcdw_custom_drop_menu li").hover(function(){
139     $(">ul:not(:animated)",this).slideDown("fast");
140     $(this).addClass("active");
141  }, function(){
142     $(">ul",this).slideUp("fast");
143     $(this).removeClass("active");
144  });
145
146
147  // design select box widget
148  $(".design_select_box select").on("click" , function() {
149    $(this).closest('.design_select_box').toggleClass("open");
150  });
151  $(document).mouseup(function (e){
152    var container = $(".design_select_box");
153    if (container.has(e.target).length === 0) {
154      container.removeClass("open");
155    }
156  });
157
158
159  //tab post list widget
160  $(".tab_post_list_widget").each(function () {
161    $('.widget_tab_post_list_button a:first-child',this).addClass('active');
162    $('.widget_tab_post_list:first',this).show();
163  });
164  $('.widget_tab_post_list_button').on('click', 'a', function(){
165    $(this).addClass('active');
166    $(this).siblings().removeClass('active');
167    var $tab_list_class = "." + $(this).attr('data-tab');
168    $(this).closest('.tab_post_list_widget').find(".widget_tab_post_list").hide();
169    $(this).closest('.tab_post_list_widget').find($tab_list_class).show();
170    $(this).closest('.tab_post_list_widget').find($tab_list_class).find('ol').slick('setPosition');
171    return false;
172  });
173
174
175  //archive list widget
176  if ($('.p-dropdown').length) {
177    $('.p-dropdown__title').click(function() {
178      $(this).toggleClass('is-active');
179      $('+ .p-dropdown__list:not(:animated)', this).slideToggle();
180    });
181  }
182
183
184  //category widget
185  $(".tcd_category_list li:has(ul)").addClass('parent_menu');
186  $(".tcd_category_list li.parent_menu > a").parent().prepend("<span class='child_menu_button'></span>");
187  $(".tcd_category_list li .child_menu_button").on('click',function() {
188     if($(this).parent().hasClass("open")) {
189       $(this).parent().removeClass("active");
190       $(this).parent().removeClass("open");
191       $(this).parent().find('>ul:not(:animated)').slideUp("fast");
192       return false;
193     } else {
194       $(this).parent().addClass("active");
195       $(this).parent().addClass("open");
196       $(this).parent().find('>ul:not(:animated)').slideDown("fast");
197       return false;
198     };
199  });
200
201
202  //search widget
203  $('.widget_search #searchsubmit').wrap('<div class="submit_button"></div>');
204  $('.google_search #searchsubmit').wrap('<div class="submit_button"></div>');
205  
206  $('.widget_archive select').wrap('<div class="select_wrap"></div>');
207  $('.widget_categories form').wrap('<div class="select_wrap"></div>');
208  
209  $('.widget_content .textwidget').addClass('post_content');
210  
211  $('.wp-calendar-table td').each(function () {
212    if ( $(this).children().length == 0 ) {
213      $(this).addClass('no_link');
214      $(this).wrapInner('<span></span>');
215    } else {
216      $(this).addClass('has_link');
217    }
218  });
219  
220
221  // header search
222  $(document).on('change keyup', 'input#header_search_input', function(){
223    if($(this).val() != ""){
224      $('#header_search').addClass('active');
225    } else {
226      $('#header_search').removeClass('active');
227    }
228  });
229
230
231  // header hover
232  $("#header").addClass("off_hover");
233  $("#header").hover(function(){
234     $(this).removeClass("off_hover");
235  }, function(){
236     $(this).addClass("off_hover");
237  });
238
239
240  // quick tag - underline ------------------------------------------
241  if ($('.q_underline').length) {
242    var gradient_prefix = null;
243
244    $('.q_underline').each(function(){
245      var bbc = $(this).css('borderBottomColor');
246      if (jQuery.inArray(bbc, ['transparent', 'rgba(0, 0, 0, 0)']) == -1) {
247        if (gradient_prefix === null) {
248          gradient_prefix = '';
249          var ua = navigator.userAgent.toLowerCase();
250          if (/webkit/.test(ua)) {
251            gradient_prefix = '-webkit-';
252          } else if (/firefox/.test(ua)) {
253            gradient_prefix = '-moz-';
254          } else {
255            gradient_prefix = '';
256          }
257        }
258        $(this).css('borderBottomColor', 'transparent');
259        if (gradient_prefix) {
260          $(this).css('backgroundImage', gradient_prefix+'linear-gradient(left, transparent 50%, '+bbc+ ' 50%)');
261        } else {
262          $(this).css('backgroundImage', 'linear-gradient(to right, transparent 50%, '+bbc+ ' 50%)');
263        }
264      }
265    });
266
267    $window.on('scroll.q_underline', function(){
268      $('.q_underline:not(.is-active)').each(function(){
269        var top = $(this).offset().top;
270        if ($window.scrollTop() > top - window.innerHeight) {
271          $(this).addClass('is-active');
272        }
273      });
274      if (!$('.q_underline:not(.is-active)').length) {
275        $window.off('scroll.q_underline');
276      }
277    });
278  }
279
280
281// responsive ------------------------------------------------------------------------
282var mql = window.matchMedia('screen and (min-width: 1251px)');
283function checkBreakPoint(mql) {
284
285 if(mql.matches){ //PC
286
287   $("html").removeClass("mobile");
288   $("html").addClass("pc");
289
290   $("#menu_button").css("display","none");
291
292   $('a.megamenu_button.type2').parent().addClass('megamenu_parent_type2');
293   $('a.megamenu_button.type3').parent().addClass('megamenu_parent_type3');
294
295   $("#global_menu li:not(.megamenu_parent)").hover(function(){
296     if( $(this).hasClass('menu-item-has-children') ){
297       $(">ul:not(:animated)",this).slideDown("fast");
298       $(this).addClass("active");
299       $('#header').addClass("active");
300     }
301   }, function(){
302     if( $(this).hasClass('menu-item-has-children') ){
303       $(">ul",this).slideUp("fast");
304       $(this).removeClass("active");
305       $('#header').removeClass("active");
306     }
307   });
308
309 } else { //smart phone
310
311   $("html").removeClass("pc");
312   $("html").addClass("mobile");
313
314   // perfect scroll
315   if ($('#drawer_menu').length) {
316     if(! $(body).hasClass('mobile_device') ) {
317       new SimpleBar($('#drawer_menu')[0]);
318     };
319   };
320/*
321   if ($('.mobile #index_tab_post_list .tab').length) {
322     if(! $(body).hasClass('mobile_device') ) {
323       new SimpleBar($('.mobile #index_tab_post_list .tab')[0]);
324     };
325   };
326*/
327
328   // drawer menu
329   $("#mobile_menu .child_menu_button").remove();
330   $('#mobile_menu li > ul').parent().prepend("<span class='child_menu_button'><span class='icon'></span></span>");
331   $("#mobile_menu .child_menu_button").on('click',function() {
332     if($(this).parent().hasClass("open")) {
333       $(this).parent().removeClass("open");
334       $(this).parent().find('>
334ul:not(:animated)').slideUp("fast");
335       return false;
336     } else {
337       $(this).parent().addClass("open");
338       $(this).parent().find('>ul:not(:animated)').slideDown("fast");
339       return false;
340     };
341   });
342
343   // drawer menu button
344   var menu_button = $('#menu_button');
345   menu_button.off();
346   menu_button.removeAttr('style');
347   menu_button.toggleClass("active",false);
348
349  // open drawer menu
350   menu_button.on('click', function(e) {
351
352      e.preventDefault();
353      e.stopPropagation();
354      $('html').toggleClass('open_menu');
355
356      // fix position for ios
357      var topPosition = $window.scrollTop();
358      $('body').css({'position':'fixed','top': - topPosition});
359
360      $('#container').one('click', function(e){
361        if($('html').hasClass('open_menu')){
362          $('html').removeClass('open_menu');
363
364          // clear fix position for ios
365          $('body').css({'position':'','top': ''});
366          $window.scrollTop(topPosition);
367
368          return false;
369        };
370      });
371
372   });
373
374 };
375};
376mql.addListener(checkBreakPoint);
377checkBreakPoint(mql);
378
379
380});

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.