PageSourceSearch

https://www.hiro-clinic.or.jp/wp-content/themes/hiro-portal/js/script.js?ver=1777021213

js hiro-clinic.or.jp collected 2026-10-02 11:30:46 UTC 3,281 bytes, 110 lines download raw bytes

1var burgerMenu = document.getElementById('burger-menu');
2var overlay = document.getElementById('menu');
3let clickClose = document.querySelectorAll('#menu ul li.menu-links');
4// burgerMenu.addEventListener('click',function(){
5//   this.classList.toggle("close");
6//   overlay.classList.toggle("overlay");
7// });
8
9for (var i = 0; i < clickClose.length; i++) {
10    clickClose[i].addEventListener('mouseup', function(event) {
11      overlay.classList.remove("overlay")
12      burgerMenu.classList.remove("close")
13    });
14}
15
16jQuery(function($){
17
18  // Sticky =========================== 
19  $(window).scroll(function () {
20
21    var topBtn = $('#return_top'); // ADDED DECLARATION HERE SO THAT IT WILL READ WHEN SCROLLING
22    topBtn.removeClass('active');
23    
24    if ($(this).scrollTop() > 100 && $(this).scrollTop() + $(window).height() < $(document).height() - 50) {    
25      topBtn.addClass('active');
26      topBtn.removeClass('relative');
27    } 
28    else if($(this).scrollTop() + $(window).height() > $(document).height() - 50) {
29      topBtn.addClass("relative")
30      topBtn.removeClass('active');
31    }    
32    else {
33      topBtn.removeClass('active');
34      topBtn.removeClass('relative');
35    }
36
37  });
38
39  // View Port =======================================================
40  function viewport() {
41    var e = window, a = 'inner';
42    if (!('innerWidth' in window )) {
43        a = 'client';
44        e = document.documentElement || document.body;
45    }
46    return { width : e[ a+'Width' ] , height : e[ a+'Height' ] }
47}
48
49});
50
51
52// Accordion Toggle Functionality
53document.querySelectorAll('.footer_link').forEach(link => {
54  link.addEventListener('click', function () {
55    const targetId = this.getAttribute('data-id');
56
57    // Remove active from all links and contents
58    document.querySelectorAll('.footer_link').forEach(l => l.classList.remove('active'));
59    document.querySelectorAll('.accordion-content').forEach(c => {
60      c.classList.remove('active');
61    });
62
63    // Add active to clicked and its content
64    this.classList.add('active');
65    const content = document.getElementById(targetId);
66    if (content) content.classList.add('active');
67  });
68});
69
70// Nav Toggle
71const menuLink = document.getElementById("web-reservation-link");
72const closeBtn = document.getElementById("close-menu-btn");
73const pageNav = document.querySelector(".page_nav_2");
74const navLinks = document.querySelectorAll(".page_nav_2 a");
75
76// メニュー開閉
77menuLink.addEventListener("click", function(event) {
78  event.preventDefault(); // リンク遷移を止める
79
80  if (pageNav.style.display === "none" || pageNav.style.display === "") {
81    pageNav.style.display = "flex";
82  } else {
83    pageNav.style.display = "none";
84  }
85
86  // active解除
87  navLinks.forEach(link => link.classList.remove("active"));
88});
89
90// 閉じるボタン
91closeBtn.addEventListener("click", function() {
92  pageNav.style.display = "none";
93});
94
95// メニュー内リンククリック
96navLinks.forEach(link => {
97  link.addEventListener("click", function() {
98
99    // メニュー閉じる
100    pageNav.style.display = "none";
101
102    // active削除
103    navLinks.forEach(el => el.classList.remove("active"));
104
105    // クリックされたものだけactive
106    this.classList.add("active");
107
108  });
109});
110// Nav Toggle End

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.