PageSourceSearch

https://mspc.jp/mg/wp-content/themes/origami_all_white_3.5.3/assets/common/js/common.js

js mspc.jp collected 2026-10-09 17:33:20 UTC 3,044 bytes, 117 lines download raw bytes

1// ローディングアニメーション
2window.onload = function() {
3  document.body.classList.add('loaded');
4}
5setTimeout(function() {
6  if(document.body.classList.contains('loaded') == false){
7    document.body.classList.add('loaded');
8    console.log('Loading Timeout');
9  }
10}, 2500);
11
12jQuery(document).ready(function($) {
13
14  // inview.js
15  $(function() {
16    $('.inview').on('inview', function(event, isInView) {
17      if (isInView) {
18          $(this).stop().addClass('show');
19      } else {
20          $(this).stop().removeClass('show');
21      }
22    });
23  });
24
25  $(function() {
26    if(document.getElementById('mv') != null){
27      $('body').addClass('haveMV');
28    }
29  });
30
31  //固定ヘッダー
32  $(function() {
33    var _window = $(window),
34        _header = $('#siteHeader'),
35        _hh,
36        _vh;
37     
38    _window.on('scroll',function(){
39        _vh = _window.innerHeight();
40        _hh = _header.height();
41
42        if (_window.scrollTop() > _vh * 0.4 && _window.scrollTop() < _vh) {
43          _header.addClass('transform');
44        } else {
45          _header.removeClass('transform');
46        }
47
48        if (_window.scrollTop() > _vh * 0.8) {
49          _header.addClass('fixed');
50        } else {
51          _header.removeClass('fixed');
52        }
53
54    });
55     
56    _window.trigger('scroll');
57  });
58
59  // ハンバーガーメニュー
60  $(function() {
61    $('.nav-btn').on('click',function(){
62        $(this).toggleClass('on');
63        $('body').toggleClass('gNavOpen');
64        if($('.gNav').hasClass('on')){
65            $('.sub-menu-switch').removeClass('on').next('ul').slideUp(200);
66            $('.gNav').removeClass('on').find('.navArea').fadeOut();
67            $('body').removeClass('gNavOpen');
68        }
69        else{
70            $('.gNav').find('.navArea').fadeIn();
71            setTimeout(function() {
72                $('.gNav').addClass('on');
73                $('body').addClass('gNavOpen');
74            }, 200);
75        }
76    });
77    $('.gNav a').on('click',function(){
78      $('.nav-btn').removeClass('on');
79      $('.gNav').removeClass('on').find('.navArea').fadeOut();
80      $('body').removeClass('gNavOpen');
81    });
82    $('.sub-menu-switch').on('click', function(){
83      $(this).toggleClass('on').next('ul').slideToggle(200);
84    });
85  });
86
87  //Full Screen
88  $(window).on('load resize', function(){
89    var hSize = $(window).height();
90    $('.full-screen').height(hSize);
91  });
92
93  //Accordion
94  $(function() {
95    $('.acc__header').on('click', function(){
96      $(this).next('.acc__body').slideToggle().toggleClass('open');
97      $(this).toggleClass('open');
98    });
99  });
100
101  // スムーススクロール
102  $(function () {
103    var headerHeight = $('#siteHeader').outerHeight();
104    var speed = 400;
105    $('a[href^="#"]:not(.switch)').click(function() {
106        var href= $(this).attr("href");
107        var target = $(href);
108        var position = target.offset().top - (headerHeight + 40);
109        $('body,html').animate({scrollTop:position}, speed, 'swing');
110        return false; 
111    });
112  });
113
114
115
116
117});

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.