PageSourceSearch

https://www.gunma-u.ac.jp/wp-content/themes/gundai_2022/js/function.js

js gunma-u.ac.jp collected 2026-09-24 08:58:41 UTC 8,496 bytes, 337 lines download raw bytes

1/*********************************
2
3	フォントサイズ変更
4
5*********************************/
6
7(function($){
8
9	$(function(){
10		fontsizeChange();
11	});
12
13	function fontsizeChange(){
14
15		var changeArea = $("html");			//フォントサイズ変更エリア
16		var btnArea = $("#fontSize");				//フォントサイズ変更ボタンエリア
17		var changeBtn = btnArea.find(".changeBtn");	//フォントサイズ変更ボタン
18		var fontSize = [62.5,75];					//フォントサイズ(HTMLと同じ並び順、幾つでもOK、単位は%)
19		var ovStr = "_ov";							//ロールオーバー画像ファイル末尾追加文字列(ロールオーバー画像を使用しない場合は値を空にする)
20		var activeClass = "current";					//フォントサイズ変更ボタンのアクティブ時のクラス名
21		var defaultSize = 0;						//初期フォントサイズ設定(HTMLと同じ並び順で0から数値を設定)
22		var cookieExpires = 7;						//クッキー保存期間(日)
23		var sizeLen = fontSize.length;
24		var useImg = ovStr!="" && changeBtn.is("[src]");
25
26		//現在クッキー確認関数
27		function nowCookie(){
28			return $.cookie("fontsize");
29		}
30
31		//画像切替関数
32		function imgChange(elm1,elm2,str1,str2){
33			elm1.attr("src",elm2.attr("src").replace(new RegExp("^(\.+)"+str1+"(\\.[a-z]+)$"),"$1"+str2+"$2"));
34		}
35
36		//マウスアウト関数
37		function mouseOut(){
38			for(var i=0; i<sizeLen; i++){
39				if(nowCookie()!=fontSize[i]){
40					imgChange(changeBtn.eq(i),changeBtn.eq(i),ovStr,"");
41				}
42			}
43		}
44
45		//フォントサイズ設定関数
46		function sizeChange(){
47			changeArea.css({fontSize:nowCookie()+"%"});
48		}
49
50		//クッキー設定関数
51		function cookieSet(index){
52			$.cookie("fontsize",fontSize[index],{path:'/',expires:cookieExpires});
53		}
54
55		//初期表示
56		if(nowCookie()){
57			for(var i=0; i<sizeLen; i++){
58				if(nowCookie()==fontSize[i]){
59					sizeChange();
60					var elm = changeBtn.eq(i);
61					if(useImg){
62						imgChange(elm,elm,"",ovStr);
63					}
64					elm.addClass(activeClass);
65					break;
66				}
67			}
68		}
69		else {
70			cookieSet(defaultSize);
71			sizeChange();
72			var elm = changeBtn.eq(defaultSize);
73			if(useImg){
74				imgChange(elm,elm,"",ovStr);
75				imgChange($("<img>"),elm,"",ovStr);
76			}
77			elm.addClass(activeClass);
78		}
79
80		//ホバーイベント(画像タイプ)
81		if(useImg){
82			changeBtn.each(function(i){
83				var self = $(this);
84				self.hover(
85				function(){
86					if(nowCookie()!=fontSize[i]){
87						imgChange(self,self,"",ovStr);
88					}
89				},
90				function(){
91					mouseOut();
92				});
93			});
94		}
95
96		//クリックイベント
97		changeBtn.click(function(){
98			var index = changeBtn.index(this);
99			var self = $(this);
100			cookieSet(index);
101			sizeChange();
102			if(useImg){
103				mouseOut();
104			}
105			if(!self.hasClass(activeClass)){
106				changeBtn.not(this).removeClass(activeClass);
107				self.addClass(activeClass);
108			}
109		});
110
111	}
112
113})(jQuery);
114
115
116
117
118/*********************************
119
120	レスポンシブメニュー
121
122*********************************/
123$(function() {
124$(document).ready(function() { 
125$('nav').meanmenu(); 
126}); 
127});
128
129/*********************************
130
131	ページトップ
132
133*********************************/
134$(function() {
135    var topBtn = $('#page-top');    
136    topBtn.hide();
137    //スクロールが100に達したらボタン表示
138    $(window).scroll(function () {
139        if ($(this).scrollTop() > 100) {
140            topBtn.fadeIn();
141        } else {
142            topBtn.fadeOut();
143        }
144    });
145    //スクロールしてトップ
146    topBtn.click(function () {
147        $('body,html').animate({
148            scrollTop: 0
149        }, 500);
150        return false;
151    });
152});
153
154
155/*******************************************
156
157	フォントサイズのフェード
158	
159*******************************************/
160$(function(){
161    $(".fontsize_01").on("click", function() {
162        $(this).next().slideToggle();
163        $(this).toggleClass("active");
164    });
165$(".fontsize_02 div").mouseover(function(){
166    $(this).addClass("over");   
167});
168$(".fontsize_02 div").mouseout(function(){
169    $(this).removeClass("over");    
170});
171});
172/*******************************************
173
174	検索のフェード
175	
176*******************************************/
177$(function(){
178    $(".search_01").on("click", function() {
179        $(this).next().slideToggle();
180        $(this).toggleClass("active");
181    });
182$(".search_02 div").mouseover(function(){
183    $(this).addClass("over");   
184});
185$(".search_02 div").mouseout(function(){
186    $(this).removeClass("over");    
187});
188});
189/*******************************************
190
191	翻訳のフェード(セレクト)
192	
193*******************************************/
194$(function(){
195    $(".language_01").on("click", function() {
196        $(this).next().slideToggle();
197        $(this).toggleClass("active");
198    });
199$(".default-language-ja div").mouseover(function(){
200    $(this).addClass("over");   
201});
202$(".default-language-ja div").mouseout(function(){
203    $(this).removeClass("over");    
204});
205});
206/*******************************************
207
208	翻訳のフェード(セレクト)スマホ
209	
210*******************************************/
211$(function(){
212    $(".language_02").on("click", function() {
213        $(this).next().slideToggle();
214        $(this).toggleClass("active");
215    });
216$(".language_02_div div").mouseover(function(){
217    $(this).addClass("over");   
218});
219$(".language_02_div div").mouseout(function(){
220    $(this).removeClass("over");    
221});
222});
223/*******************************************
224
225	divアコーディオン
226	
227*******************************************/
228$(function(){
229    $(".div_acdn_title").on("click", function() {
230        $(this).next().slideToggle();
231        $(this).toggleClass("active");
232    });
233$(".div_acdn_content").mouseover(function(){
234    $(this).addClass("over");   
235});
236$(".div_acdn_content").mouseout(function(){
237    $(this).removeClass("over");    
238});
239});
240/*******************************************
241
242	SDGsアコーディオン
243	
244*******************************************/
245$(function(){
246    $(".sdgs_title").on("click", function() {
247        $(this).next().slideToggle();
248        $(this).toggleClass("active");
249    });
250$(".sdgs_content").mouseover(function(){
251    $(this).addClass("over");   
252});
253$(".sdgs_content").mouseout(function(){
254    $(this).removeClass("over");    
255});
256});
257
258/*******************************************
259
260     スマホ用サブメニュー展開
261	 
262*******************************************/
263
264$(document).ready(function() {
265    $('.btn-1').click(function () {
266        $('.open-1').toggleClass('active');
267        $(this).toggleClass('on');
268        $(this).toggleClass('move-1');
269    });
270});
271
272/*******************************************
273
274     スライドショー(投稿・固定ページ)
275	 
276*******************************************/
277$(function(){
278if ($(window).width() > 480){
279	var windowWidth = jQuery(window).width();
280	var width = windowWidth / 3;
281	$('.bxslider').bxSlider({ 
282	auto: true,
283	controls: false,
284	maxSlides: 4,
285	minSlides: 4,
286	slideWidth:width,
287	moveSlides:1,
288	slideMargin: 10,
289		touchEnabled:false,
290 });
291    } else 	  {
292	$('.bxslider').bxSlider({ 
293	auto: true,
294	controls: false,
295	maxSlides: 1,
296	minSlides: 1,
297	moveSlides:1,
298	slideMargin: 0,
299	slideWidth:400,
300 });  
301  }
302});
303/*******************************************
304
305     ヘッダー(固定)
306	 
307*******************************************/
308$(function() {
309    var fix_header = $('#fix_header');    
310    fix_header.hide();
311    //スクロールが100に達したらボタン表示
312    $(window).scroll(function () {
313        if ($(this).scrollTop() > 70) {
314            fix_header.fadeIn();
315        } else {
316            fix_header.fadeOut();
317        }
318    });
319
320});
321
322/*******************************************
323
324     右端フロートボタン(固定)
325	 
326*******************************************/
327    $(function() {
328        var $float_button = $('#float_button');
329        $(window).scroll(function() {
330            if ($(window).scrollTop() > 70) {
331                $float_button.addClass('fixed');
332            } else {
333                $float_button.removeClass('fixed');
334            }
335        });
336    });
337

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.