PageSourceSearch

https://www.rinri-jpn.or.jp/wp-content/themes/rinri-jpn/js/common.js

js rinri-jpn.or.jp collected 2026-10-02 11:22:48 UTC 3,627 bytes, 160 lines download raw bytes

1var HEADER_HEIGHT = 100;
2var SCROLL_SPEED = 500;
3
4/**
5 *
6 * @param {string} sel セレクター
7 * @return {boolean} true - 要素が存在する
8 */
9function found(sel) {
10  return $(sel).length !== 0;
11}
12
13function isSp() {
14  return navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/);
15}
16
17function colorboxDialog(url, w, h){
18  $.colorbox({
19    open: true,
20    iframe: true,
21    width: w,
22    height: h,
23    opacity: 0.8,
24    closeButton: false,
25    scrolling: false,
26    overlayClose: true,
27    href: url,
28  });
29}
30
31var uaa = navigator.userAgent;
32var macOs = uaa.match(/Mac|PPC/); //Mac OS
33
34(function(){
35    if (macOs) {
36        $('body').addClass('macOs');
37    }
38}).call(this);
39
40$(function () {
41  HEADER_HEIGHT = $('header .wrapper').height();
42
43  /* smooth scroll */
44  $('a[href^="#"]').on('click', function () {
45    var href = $(this).attr("href");
46    var target;
47    var position;
48    if (!href || href === '#') {
49      target = $('html');
50      position = target.offset().top;
51    } else {
52      target = $(href);
53      position = target.offset().top - HEADER_HEIGHT;
54    }
55    $("html, body").animate({
56      scrollTop: position
57    }, SCROLL_SPEED, "swing");
58    return false;
59  });
60
61  // 表示位置をヘッダ分ずらす
62  (function(){
63    // console.log(location.hash);
64    if (location.hash && found(location.hash)) {
65      var target = $(location.hash);
66      var position = target.offset().top - HEADER_HEIGHT;
67      $("html, body").animate({
68        scrollTop: position
69      }, SCROLL_SPEED, "swing");
70    }
71  }());
72
73  $('.menu_btn').on('click', function () {
74    $('.menu_wrapper').show();
75  });
76  $('.menu_close').on('click', function () {
77    $('.menu_wrapper').hide();
78  });
79
80  $('.gotop').show().find('button').on('click', function () {
81    $('html, body').animate({
82      scrollTop: 0
83    }, SCROLL_SPEED, 'swing');
84    return false;
85  });
86
87if(document.URL.match(/rinri-jpn\.or\.jp\/$|rinri-jpn\.or\.jp$/)){
88$(window).on('load', function () {
89    $('#news_panel,#newsOverlay').toggleClass('open');
90    return false;
91  });
92}
93
94  $('#news_btn').on('click', function () {
95    $('#news_panel,#newsOverlay').toggleClass('open');
96    return false;
97  });
98
99  $('.news_btnC').on('click', function () {
100    $('#news_panel,#newsOverlay').removeClass('open');
101    return false;
102  });
103  $('#newsOverlay,#fixedNav').click(function(){
104    $('#news_panel,#newsOverlay').removeClass('open');
105  });
106  // onLoadEffect
107  $('.onLoadEffect').addClass('appeared');
108
109  // お知らせ
110  if (found('.event_container')) {
111    $('.event_container').slick({
112      infinite: false,
113      slidesToShow: 3,
114      slidesToScroll: 3,
115      responsive: [{
116        breakpoint: 767,
117        settings: {
118          slidesToShow: 2,
119          slidesToScroll: 2,
120        }
121      }]
122    });
123  }
124
125  // おすすめの本
126  if (found('.book_container')) {
127    $('.book_container').slick({
128      infinite: false,
129      slidesToShow: 4,
130      slidesToScroll: 4,
131      responsive: [{
132        breakpoint: 767,
133        settings: {
134          slidesToShow: 2,
135          slidesToScroll: 2,
136        }
137      }]
138    });
139  }
140
141  if (isSp()) {
142    // 電話番号リンク化
143    $('.tel_linker').each(function (index, elem) {
144      var $target = $(elem);
145      var tel = $target.text();
146      $target.html($('<a>').attr('href', 'tel:' + tel.replace(/-\(\)/g, '')).text(tel));
147    });
148  }
149  var replaceWidth = 768;
150  var windowWidth = parseInt($(window).width());
151
152      $('[data-fancybox]').fancybox({
153        arrows: true,
154        infobar: false,
155        hideScrollbar: true,
156        transitionEffect: "tube",
157        transitionDuration: 500
158      });
159
160});

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.