PageSourceSearch

https://www.kr-kokuho.or.jp/js/com.js

js kr-kokuho.or.jp collected 2026-10-04 03:31:10 UTC 4,107 bytes, 157 lines download raw bytes

1//フォントサイズ
2$(window).load(function(){
3	$("ul.tsize li a").click(function(){
4		$("ul.tsize li").removeClass("current");
5		var fontCss = $(this).parent("li").attr("class");
6		$(this).parent("li").addClass("current");
7		if(fontCss == "large"){
8		  $("body").css("font-size","20px");
9		}else if(fontCss == "nomal"){
10		  $("body").css("font-size","18px");
11		}else if(fontCss == "small"){
12		  $("body").css("font-size","16px");
13		}
14 	});
15});
16
17
18//スムーススクロール
19$(function() {
20 $('a[href^=#]').click(function() {
21      // スクロールの速度
22      var speed = 400; // ミリ秒
23      // アンカーの値取得
24      var href= $(this).attr("href");
25      // 移動先を取得
26      var target = $(href == "#" || href == "" ? 'html' : href);
27      // 移動先を数値で取得
28      if(target.length) {
29      var position = target.offset().top;
30      }
31      // スムーススクロール
32      $('body,html').animate({scrollTop:position}, speed, 'swing');
33      return false;
34   });
35 });
36 
37 
38 
39 // page Topフェードイン・アウト
40$(function(){
41	$(window).bind("scroll", function() {
42	if ($(this).scrollTop() > 150) { 
43		$(".btnPagetop").fadeIn();
44	} else {
45		$(".btnPagetop").fadeOut();
46	}
47	// ドキュメントの高さ
48	scrollHeight = $(document).height();
49	// ウィンドウの高さ+スクロールした高さ→ 現在のトップからの位置
50	scrollPosition = $(window).height() + $(window).scrollTop();
51	// フッターの高さ
52	footHeight = $("footer").height();
53	
54	// スクロール位置がフッターまで来たら
55	if ( scrollHeight - scrollPosition  <= footHeight ) {
56		// ページトップリンクをフッターに固定
57		if($(window).width() < 640) {
58		$(".btnPagetop a").css({"position":"absolute","bottom": "-30.5vw","right":"3.12vw","margin-right":"0px"});
59		} else {
60		$(".btnPagetop a").css({"position":"absolute","bottom": "50px","right":"-15px","margin-right":"0px"});
61		}
62		
63	} else {
64		// ページトップリンクを右下に固定
65		if($(window).width() < 640) {
66		$(".btnPagetop a").css({"position":"fixed","bottom": "20px","right":"3.12vw","margin-right":"0px"});
67		} else {
68		$(".btnPagetop a").css({"position":"fixed","bottom": "20px","right":"50%","margin-right":"-505px"});
69		}
70		
71		}
72	});
73});
74
75
76//グローバルナビ
77$(function() {
78	$('nav ul.main > li').hover(function(){
79		if($(window).width() > 640) {
80        $('>ul:not(:animated)',this).css("display","block");
81		}
82    },function(){
83		if($(window).width() > 640) {
84        $('>ul',this).css("display","none");
85		//$('>ul',this).css("border","none");
86		}
87    });
88});
89
90//スマホグローバルナビ
91$(window).load(function(){
92var flg = "close"; 
93$(".btnMenu a").click(function(){
94//event.stopPropagation();
95var h = $("headert h1").height();
96$("header nav").css("top", h);
97$("header nav").animate({ height: 'toggle', opacity: 'toggle' }, 'first');
98if(flg == "close"){
99$(".btnMenu").css("z-index","1020");
100$(".btnMenu").addClass("active");
101flg = "open";
102$(".btnMenu div").text("閉じる");
103//$(".btnMenu div").css("left","12px");
104$("header .bg").css("display","block");
105}else{
106$(".btnMenu").css("z-index","1000");
107$(".btnMenu").removeClass("active");
108flg = "close";
109$(".btnMenu div").text("メニュー");
110//$(".btnMenu div").css("left","7px");
111$("header .bg").css("display","none");
112}
113});
114
115/*$(document).click(function(e) {	
116	if (!$(e.target).closest('nav').length) {
117	if(flg == "open"){
118	$("header nav").animate({ height: 'toggle', opacity: 'toggle' }, 'first');
119	$(".btnMenu").removeClass("active");
120	flg = "close";
121	}
122	}
123});*/
124
125$('nav ul.main li a').click(function(){
126if($(window).width() < 641) {
127$(this).parent().children("ul").slideToggle();
128$(this).toggleClass("open");
129}
130});
131
132$('nav ul.main li.close a').click(function(){
133$("header nav").animate({ height: 'toggle', opacity: 'toggle' }, 'first');
134if(flg == "close"){
135}else{
136$(".btnMenu").css("z-index","1000");
137$(".btnMenu").removeClass("active");
138flg = "close";
139$(".btnMenu div").text("メニュー");
140/*$(".btnMenu div").css("left","7px");*/
141$("header .bg").css("display","none");
142}
143});
144
145
146
147});
148
149
150
151
152
153
154
155
156
157

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.