PageSourceSearch

https://naominokai.net/wp/wp-content/themes/honbu/js/common.js

js naominokai.net collected 2026-10-05 09:54:38 UTC 4,862 bytes, 166 lines download raw bytes

1$(function(){
2
3	
4	/*-------------------------------------------------
5	ドロワー
6	----------------------------------------------- */
7	$('.remodal.drawer .list_btn').click(function () {
8		$(this).toggleClass('open');
9		$(this).next('ul').slideToggle();
10    });
11
12
13	/*-------------------------------------------------
14	ページ内リンクをスムーズにスクロール
15	----------------------------------------------- */
16    $('a[href^="#"]').click(function(){
17		var speed = 1000;
18		var href= $(this).attr("href");
19    	var target = $(href == "#" || href == "" ? 'html' : href);
20		var position = target.offset().top;
21    	$("html, body").animate({scrollTop:position}, speed, "swing");
22    	return false;
23    });
24	
25	/*-------------------------------------------------
26	高さを揃える
27	----------------------------------------------- */
28	$('.js_mh_item').matchHeight();
29	$('.js_mh_item2').matchHeight();
30	
31	
32	/*-------------------------------------------------
33	月別記事一覧SP
34	----------------------------------------------- */
35	$('.remodal.month .year_btn').click(function () {
36		$(this).toggleClass('open');
37		$(this).next('ul').slideToggle();
38    });
39	
40	
41	/*-------------------------------------------------
42    ローディング
43    ----------------------------------------------- */
44    var timer = setInterval(function(){
45        if($('html').hasClass("wf-active")){
46            $('.load_mask').fadeOut('slow');
47			dispTitle();
48			dispCopy();
49            clearTimeout(timer);
50        }
51    }, 10);
52	
53	/* 下層ページタイトル表示
54	-------------------------------- */
55	function dispTitle(){
56		if($('.com_page_title').length > 0){
57			$('.com_page_title').addClass('disp');
58		}
59	}
60	
61	/* メインビジュアル表示
62	-------------------------------- */
63	function dispCopy(){
64		if($('.sec_mainv .main_copy').length > 0){
65			$('.sec_mainv .main_copy').addClass('disp');
66		}
67	}
68	
69	
70});
71	
72/* ----------------------------------------
73 サイドバーをスクロール固定
74---------------------------------------- */
75$(function(){
76	
77	$(window).on('load scroll resize', function () {
78		fixedSidebar();
79	});
80	
81	function fixedSidebar(){
82		var $window_bp = 767;
83		var $right_box = $(".main_content");
84		var $sidebar = $(".sidebar");
85		var $header = $(".header");//固定ヘッダー
86		var pos_btm = 10;//固定したい下位置
87		
88		var $side_left = $(".sidebar_wrap");//サイドバーの位置
89		
90		
91		//ウィンドウサイズ768px以上の場合、かつコンテンツよりサイドバーが低い場合のみ
92		if($(window).width() > $window_bp && $right_box.outerHeight() > $sidebar.outerHeight()){
93			
94			if($(window).height() - $header.outerHeight() < $sidebar.outerHeight()){
95				//サイドバーの高さがウィンドウの表示領域より高いとき、サイドバーをbottomで固定
96				
97				if($right_box.offset().top + $sidebar.outerHeight() < $(window).scrollTop() + $(window).height() - pos_btm){
98					//サイドバーが最後まで表示されたら
99
100					var left = $side_left.offset().left;
101					var bottom = 0;
102
103					if($right_box.offset().top + $right_box.outerHeight() < $(window).scrollTop() + $(window).height() - pos_btm){
104						//コンテンツが下まで表示されたら、コンテンツの下側で固定
105						bottom = ($(window).scrollTop() + $(window).height() + 50) - ($right_box.offset().top + $right_box.outerHeight());
106					}else{
107						//コンテンツの下まで表示される前
108						bottom = pos_btm;
109					}
110
111					$sidebar.css({
112						"position":"fixed",
113						"left":left,
114						"top":"auto",
115						"bottom":bottom,
116					});
117
118				}else{
119					//サイドバーが下まで表示される前
120					$sidebar.css({
121						"position":"static"
122					});
123
124				}
125			}else{
126				//サイドバーの高さがウィンドウの表示領域より低いとき、サイドバーをtopで固定
127				if($right_box.offset().top < $(window).scrollTop() + $header.outerHeight()){
128					//スクロールされたら
129					
130					var left = $side_left.offset().left;
131					
132					if($right_box.offset().top + $right_box.outerHeight() < $(window).scrollTop() + $sidebar.outerHeight() + $header.outerHeight()){
133						//コンテンツが下まで表示されたら、コンテンツの下側で固定
134						bottom = ($(window).scrollTop() + $(window).height()) - ($right_box.offset().top + $right_box.outerHeight());
135						$sidebar.css({
136							"position":"fixed",
137							"left":left,
138							"top":"auto",
139							"bottom":bottom,
140						});
141					}else{
142						//コンテンツの下まで表示される前
143						$sidebar.css({
144							"position":"fixed",
145							"left":left,
146							"top":$header.outerHeight(),
147							"bottom":"auto",
148						});
149					}
150				}else{
151					$sidebar.css({
152						"position":"static"
153					});
154				}
155			}
156			
157		}else{
158			$sidebar.css({
159				"position":"static"
160			});
161			
162		}
163	}
164	
165});
166	

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.