PageSourceSearch

https://keio-vascularsurgery.com/user/theme/keio-vascularsurgery/media/js/common.js

js keio-vascularsurgery.com collected 2026-10-06 04:14:12 UTC 3,170 bytes, 117 lines download raw bytes

1var PC_FIXED = false;
2var SP_FIXED = false;
3var SP_WIDTH = 769;
4var SPEED = 500;
5var scrolled = $(window).scrollTop();
6
7function scrollPosition(position) {
8  position -= PC_FIXED && $(window).innerWidth() >= SP_WIDTH || SP_FIXED && $(window).innerWidth() < SP_WIDTH ? $('header').innerHeight() : 0;
9  $('html, body').animate({
10    scrollTop: position
11  }, SPEED);
12}
13
14//(<a href="#top">の様に記述すると滑らかにスクロールする。)
15$(function () {
16  $('a[href^="#"]').click(function () {    
17    var position = $(this.hash).length > 0 ? $(this.hash).offset().top : scrolled;
18    scrollPosition(position);
19    return false;
20  });
21});
22
23// 一定量スクロールするとページトップに戻るが表示される(場所等の指定はcommon.scssにて)
24$(function () {
25  var top_btn = $('.pagetop');
26  top_btn.hide();
27  $(window).scroll(function () {
28    $(this).scrollTop() > 100 ? top_btn.fadeIn() : top_btn.fadeOut();
29  });
30
31  top_btn.click(function () {
32    scrollPosition(0);
33    return false;
34  });
35});
36
37// rollover(_offと末尾についた画像をオンマウスで_onとついた画像に切り替える)
38$(function () {
39  $('img').hover(
40    function () {
41      $(this).attr('src', $(this).attr('src').replace('_off.', '_on.'));
42    },
43    function () {
44      $(this).attr('src', $(this).attr('src').replace('_on.', '_off.'));
45    }
46  );
47});
48
49$(function () {
50  var menu_btn = $('.slidemenu-btn');
51  var body = $(document.body);
52  var top = 0;
53  var menu_open = false;
54
55  menu_btn.on('click', function () {
56    if (!menu_open) {
57      top = $(window).scrollTop();
58    }
59    $('.tel-btn').css('display', 'block');
60    body.toggleClass('open');
61    menu_btn.toggleClass('active');
62    menu_open = true;
63    if (body.hasClass('open')) {
64      $('.tel-btn').css('display', 'none');
65      body.css({
66        'height': window.innerHeight,
67        'top': -top
68      });
69    } else {
70      body.removeAttr('style');
71      $(window).scrollTop(top);
72      menu_open = false;
73    }
74  });
75});
76
77
78//クリックで画像変更
79$(function () {
80  $('.slidemenu-btn').click(function () {
81    var img = $(this).children('img');
82    if ($(this).hasClass('active')) {
83      $(img).attr('src', $(img).attr('src').replace('menu','close'));
84    }
85    else {
86      $(img).attr('src', $(img).attr('src').replace('close','menu'));
87    }
88  });
89});
90
91//ヘッダーが固定の時スマホの時のページ内リンク用
92$(function () {
93  $(document).on('ready', function() {
94    if (location.hash != "") {
95	    var pos = $(location.hash).offset().top;
96      if (PC_FIXED && $(window).innerWidth() >= SP_WIDTH || SP_FIXED && $(window).innerWidth() < SP_WIDTH) {
97        pos -= $('header').innerHeight();
98        $("html, body").animate({ scrollTop: pos }, 1, "swing");
99      }
100      else {
101        return false;
102      }
103    }
104  });
105});
106
107//パンくずリスト第2階層用
108$(function () {
109  $('.bread-crumbs li>a').each(function () {    
110    if (location.pathname == ($(this).attr('href') + 'index.html')) {  
111      $(this).parent('li').remove();  
112    }
113    if ($(this).is(':empty')) {
114      $(this).parent('li').remove();
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.