PageSourceSearch

https://kaigoportal.jp/common/js/common.js

js kaigoportal.jp collected 2026-10-08 10:32:50 UTC 4,310 bytes, 148 lines download raw bytes

1/* 
2****************************************************/
3//ヘッダーファイルパス
4//href="{$root}" リンクにいれる
5var headerhtml = '_inheader.html';
6//ヘッダーの読み込み
7function headerInclude(directory){
8  $.ajax({
9    type: 'get',
10    url: directory + headerhtml,
11    dataType: 'html',
12    success: function(data) {
13        data = data.replace(/\{\$root\}/g, directory);
14        $("#header").append(data);
15
16
17$(".openbtn").click(function () {//ボタンがクリックされたら
18  $(this).toggleClass('active');//ボタン自身に activeクラスを付与し
19    $("#g-nav").toggleClass('panelactive');//ナビゲーションにpanelactiveクラスを付与
20});
21
22$("#g-nav a").click(function () {//ナビゲーションのリンクがクリックされたら
23    $(".openbtn").removeClass('active');//ボタンの activeクラスを除去し
24    $("#g-nav").removeClass('panelactive');//ナビゲーションのpanelactiveクラスも除去
25});
26
27
28
29
30       // console.log(data)
31    }
32  });
33}
34//フッターファイルパス
35var footerhtml = '_infooter.html';
36//フッターの読み込み
37function footerInclude(directory){
38  $.ajax({
39    type: 'get',
40    url: directory + footerhtml,
41    dataType: 'html',
42    success: function(data) {
43    //  console.log(data)
44        data = data.replace(/\{\$root\}/g, directory);
45        $("#footer").append(data);
46    }
47  });
48}
49
50
51/* ツールチップ
52****************************************************/
53tippy('.cap', {
54  placement: 'top-start',
55
56  animation: 'shift-toward-subtle',
57  
58  theme: 'light-border',
59  
60  duration: 200,
61}
62)
63
64/*	ページスクロールするとページトップへボタンを表示
65-----------------------------------------------*/
66$(document).ready(function() {
67	var flag = false;
68	var pagetop = $('.pagetop');
69	$(window).scroll(function () {
70		if ($(this).scrollTop() > 100) { /* どれくらいスクロールしたら表示されるか */
71			if (flag == false) {
72				flag = true;
73				pagetop.stop().animate({
74					'bottom': '10px'
75				}, 200);	/* ボタン表示のアニメーションの速度 */
76			}
77		} else {
78			if (flag) {
79				flag = false;
80				pagetop.stop().animate({
81					'bottom': '-80px'
82				}, 200);	/* ボタン表示のアニメーションの速度 */
83			}
84		}
85	});
86	pagetop.click(function () {
87		$('body, html').animate({ scrollTop: 0 }, 500);	/* スクロールで戻る時の速度 */
88		return false;
89	});
90});
91
92
93
94/*	スムーズスクロール
95-----------------------------------------------*/
96
97$(function(){
98	$(window).scroll(function (){
99		$('.fade-in').each(function(){
100			var elemPos = $(this).offset().top;
101			var scroll = $(window).scrollTop();
102			var windowHeight = $(window).height();
103			if (scroll > elemPos - windowHeight + 200){
104				$(this).addClass('scroll-in');
105			}
106		});
107	});
108});
109
110$('a[href*="#"]').click(function () {
111	var headerH = 150;
112  var elmHash = $(this).attr('href'); //ページ内リンクのHTMLタグhrefから、リンクされているエリアidの値を取得
113  var pos = $(elmHash).offset().top - headerH ;  //idの上部の距離を取得
114  $('body,html').animate({scrollTop: (pos)}, 500); //取得した位置にスクロール。500の数値が大きくなるほどゆっくりスクロール
115  return false;
116});
117
118
119/*	アコーディオンメニュー
120-----------------------------------------------*/
121	$(function(){
122		//クリックで動く
123		$('.comment dt').click(function(){
124			$(this).toggleClass('open');
125			$(this).next("dd").slideToggle();
126		});
127	});
128
129
130/*	SNSシェア
131-----------------------------------------------*/
132  // 現在のページURLを取得
133  const currentUrl = encodeURIComponent(window.location.href);
134
135  // 各シェアリンクのベースURLを設定
136  const shareLinks = {
137    'fb-share': `https://www.facebook.com/sharer/sharer.php?u=${currentUrl}`,
138    'x-share': `https://x.com/share?url=${currentUrl}`,
139    'line-share': `https://social-plugins.line.me/lineit/share?url=${currentUrl}`
140  };
141
142  // 各リンクにURLをセット
143  for (const id in shareLinks) {
144    const link = document.getElementById(id);
145    if (link) {
146      link.href = shareLinks[id];
147    }
148  }

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.