PageSourceSearch

https://medigle.jp/data/themes/medigle_service_2019/js/common.js

js medigle.jp collected 2026-10-04 01:50:01 UTC 3,433 bytes, 138 lines download raw bytes

1var PC_FIXED = true;
2var SP_FIXED = true;
3var SP_WIDTH = 769;
4var SPEED = 500;
5
6function scrollPosition(position) {
7  position -= PC_FIXED && $(window).innerWidth() >= SP_WIDTH || SP_FIXED && $(window).innerWidth() < SP_WIDTH ? $('header').innerHeight() : 0;
8  $('html, body').animate({
9    scrollTop: position
10  }, SPEED);
11}
12
13//(<a href="#top">の様に記述すると滑らかにスクロールする。)
14$(function () {
15  $('a[href^="#"]').click(function () {
16    var position = $(this.hash).length > 0 ? $(this.hash).offset().top : 0;
17    scrollPosition(position);
18  });
19});
20
21// 一定量スクロールするとページトップに戻るが表示される(場所等の指定はcommon.scssにて)
22$(function () {
23  var top_btn = $('.pagetop');
24  top_btn.hide();
25  $(window).scroll(function () {
26    $(this).scrollTop() > 100 ? top_btn.fadeIn() : top_btn.fadeOut();
27  });
28
29  top_btn.click(function () {
30    scrollPosition(0);
31    return false;
32  });
33});
34
35
36
37$(function () {
38  var top_btn = $('.fix-bnr');
39  top_btn.hide();
40  $(window).scroll(function () {
41    $(this).scrollTop() > 100 ? top_btn.fadeIn() : top_btn.fadeOut();
42  });
43});
44
45//var timeoutId ;
46//window.addEventListener( "scroll", function () {
47//  clearTimeout( timeoutId ) ;
48//  timeoutId = setTimeout( function () {
49//    $('.fix-bnr').fadeOut();
50//  }, 3000 ) ;
51//} ) ;
52
53
54$(function () {
55  $('.fix-btn').on('click', () => {
56    $('.fix-bnr').remove();
57  });
58});
59
60
61// rollover(_offと末尾についた画像をオンマウスで_onとついた画像に切り替える)
62$(function () {
63  $('img').hover(
64    function () {
65      $(this).attr('src', $(this).attr('src').replace('_off.', '_on.'));
66    },
67    function () {
68      $(this).attr('src', $(this).attr('src').replace('_on.', '_off.'));
69    }
70  );
71});
72
73$(function () {
74  var menu_btn = $('.slidemenu-btn');
75  var body = $(document.body);
76  var top = 0;
77  var menu_open = false;
78
79  $(window).scroll(function () {
80    $(this).scrollTop() > 100 ? body.addClass('scroll') : body.removeClass('scroll');
81  });
82
83  menu_btn.on('click', function () {
84    if (!menu_open) {
85      top = $(window).scrollTop();
86    }
87    body.toggleClass('open');
88    menu_btn.toggleClass('active');
89    menu_open = true;
90    if (body.hasClass('open')) {
91      body.css({
92        'height': window.innerHeight,
93        'top': -top
94      });
95    } else {
96      body.removeAttr('style');
97      $(window).scrollTop(top);
98      menu_open = false;
99    }
100  });
101});
102
103//ヘッダーが固定の時スマホの時のページ内リンク用
104$(function () {
105  $(document).on('ready', function () {
106    if (location.hash != "") {
107      var pos = $(location.hash).offset().top;
108      if (PC_FIXED && $(window).innerWidth() >= SP_WIDTH || SP_FIXED && $(window).innerWidth() < SP_WIDTH) {
109        pos -= $('header').innerHeight();
110        $("html, body").animate({
111          scrollTop: pos
112        }, 1, "swing");
113      } else {
114        return false;
115      }
116    }
117  });
118});
119
120new ViewportExtra(375);
121
122//show-more
123$(function () {
124  $('.show-more').click(function () {
125    var show_text = $(this).parent('.list-wrapper').find('.logo-list');
126    var small_height = 90 //This is initial height.
127    var original_height = show_text.css({
128      height: 'auto'
129    }).height();
130
131    show_text.height(small_height).animate({
132      height: original_height
133    }, 300, function () {
134      show_text.height('auto');
135    });
136    $(this).hide();
137  });
138})

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.