PageSourceSearch

https://www.gku.ac.jp/common/js/script.js

js gku.ac.jp collected 2026-10-02 17:32:32 UTC 8,394 bytes, 256 lines download raw bytes

1//==================================================
2//  
3//  岐阜協立大学
4//  /common/js/script.css
5//  
6//==================================================
7
8
9//--------------------------------------------------
10//   Header Nav
11//--------------------------------------------------
12$(function() {
13  $('.header_nav > li.h_nav01 > a').click(function() {
14    $('.header_nav > li.h_nav01 .h_nav_s').fadeToggle();
15    $('.header_nav > li.h_nav04 .h_nav_s').fadeOut();
16    $('.header_nav > li.h_nav05 .h_nav_s').fadeOut();
17  });
18  $('.header_nav > li.h_nav04 > a').click(function() {
19    $('.header_nav > li.h_nav04 .h_nav_s').fadeToggle();
20    $('.header_nav > li.h_nav01 .h_nav_s').fadeOut();
21    $('.header_nav > li.h_nav05 .h_nav_s').fadeOut();
22  });
23  $('.header_nav > li.h_nav05 > a').click(function() {
24    $('.header_nav > li.h_nav05 .h_nav_s').fadeToggle();
25    $('.header_nav > li.h_nav01 .h_nav_s').fadeOut();
26    $('.header_nav > li.h_nav04 .h_nav_s').fadeOut();
27  });
28  $('.h_nav_s a').click(function() {
29    $('.h_nav_s').fadeOut();
30  });
31});
32
33
34
35//--------------------------------------------------
36//   Global Nav
37//--------------------------------------------------
38// Opne Nav
39$(function () {
40  const isGnav = $("#gnav").length > 0;
41
42  $(".global_nav_button").click(function () {
43    const winWidth = $(window).width();
44    const $targetNav = isGnav ? $("#gnav") : $(".global_nav_fixed_base");
45
46    if (winWidth <= 768) {
47      $targetNav.fadeToggle();
48      $(this).toggleClass("opened");
49    } else {
50      $targetNav.fadeToggle();
51      $(this).toggleClass("opened");
52    }
53  });
54
55  $(".g_nav_s_cassette a, .g_nav_m a").click(function () {
56    const $targetNav = isGnav ? $("#gnav") : $(".global_nav_fixed_base");
57    $targetNav.fadeOut();
58    $(".global_nav_button").removeClass("opened");
59  });
60
61  $(window).on("resize", function () {
62    const winWidth = $(window).width();
63    const $targetNav = isGnav ? $("#gnav") : $(".global_nav_fixed_base");
64
65    if (winWidth <= 768) {
66      $targetNav.hide();
67      $(".global_nav_button").removeClass("opened");
68    } else {
69      if (isGnav) {
70        // #gnav のときだけ display:block にする
71        $targetNav.css("display", "block");
72      }
73    }
74  }).trigger("resize");
75});
76
77
78
79// Global Nav Tab
80$(function() {
81  $('.global_nav__sp .g_nav_l li').click(function() {
82    if ($(this).hasClass('no-submenu')) {
83      // 他のすべてのサブメニューを非表示にする
84      $('.global_nav__sp .g_nav_s_wrap .g_nav_s_cassette').css('display','none');
85      return; // サブメニューなしなので、何もしない
86    }
87      
88    var index = $('.global_nav__sp .g_nav_l li').index(this);
89    $('.global_nav__sp .g_nav_s_wrap .g_nav_s_cassette').css('display','none');
90      
91     // 該当するサブメニューを表示
92    // no-submenuを持たないliのみを対象にしたインデックスで表示
93    var realIndexsp = $('.global_nav__sp .g_nav_l li:not(.no-submenu)').index(this);
94    
95    $('.global_nav__sp .g_nav_s_wrap .g_nav_s_cassette').eq(realIndexsp).fadeIn();
96    $('.global_nav__sp .g_nav_l li').removeClass('select');
97    $(this).addClass('select')
98  });
99  $('.global_nav_button, .g_nav_s_cassette a, .g_nav_m a').click(function() {
100    $('.g_nav_s_wrap .g_nav_s_cassette').css('display','none');
101    $('.g_nav_l li').removeClass('select');
102  });
103});
104$(function() {
105  $('.global_nav__pc .g_nav_l li').mouseover(function() {
106      // サブメニューなしのli(no-submenuクラスが付いているli)にマウスオーバーした場合
107    if ($(this).hasClass('no-submenu')) {
108      // 他のすべてのサブメニューを非表示にする
109      $('.global_nav__pc .g_nav_s_wrap .g_nav_s_cassette').css('display','none');
110      return; // サブメニューなしなので、何もしない
111    }
112      
113    var index = $('.global_nav__pc .g_nav_l li').index(this);
114    $('.global_nav__pc .g_nav_s_wrap .g_nav_s_cassette').css('display','none');
115      
116      // 該当するサブメニューを表示
117    // no-submenuを持たないliのみを対象にしたインデックスで表示
118    var realIndex = $('.global_nav__pc .g_nav_l li:not(.no-submenu)').index(this);
119      
120    $('.global_nav__pc .g_nav_s_wrap .g_nav_s_cassette').eq(realIndex).fadeIn();
121    $('.global_nav__pc .g_nav_l li').removeClass('select');
122    $(this).addClass('select');
123  });
124  $('.global_nav_button, .global_nav__pc .g_nav_s_cassette a, .global_nav__pc .g_nav_m a').click(function() {
125    $('.global_nav__pc .g_nav_s_wrap .g_nav_s_cassette').css('display','none');
126    $('.global_nav__pc .g_nav_l li').removeClass('select');
127  });
128});
129
130
131if (window.matchMedia( "(max-width: 768px)" ).matches) {
132  /* for SP */
133  $(function(){
134    $(".nav_btn > a").click(function() {
135      $(".nav_wrap").slideToggle();
136      $(".nav_btn").toggleClass("opened");
137      $(".sub_nav").slideUp();
138      $(".sub_nav_btn").removeClass("opened");
139    });
140    $(".sub_nav_btn").click(function() {
141      $(this).next(".sub_nav").slideToggle();
142      $(this).toggleClass("opened");
143    });
144    $(".nav_wrap li a").click(function() {
145      $(".nav_wrap").slideUp();
146      $(".sub_nav").slideUp();
147      $(".nav_btn, .sub_nav_btn").removeClass("opened");
148    });
149  });
150} else {
151  /* for PC */
152  $(function(){
153    $(".global_nav > li").hover(function() {
154      $(this).children(".sub_nav").slideToggle();
155    });
156  });
157}
158
159
160
161//--------------------------------------------------
162//   Sub Nav
163//--------------------------------------------------
164// Current Check
165$(function(){
166  $('.sub_nav .current').removeClass('current');
167  $('.sub_nav a').filter(function(){return $(this).prop('href')==location.href;}).addClass('current');
168  $('.sub_nav > li > ul > li > a.current').closest('.sub_nav > li').addClass('cu_parent');
169  $('.sub_nav > li > ul > li > ul > li > a.current').closest('.sub_nav > li').addClass('cu_parent');
170});
171
172
173
174//--------------------------------------------------
175//   Smooth Scroll
176//--------------------------------------------------
177$(function(){
178  $('a[href^="#"]').click(function(){
179    var speed = 800;
180    var href= $(this).attr("href");
181    var target = $(href == "#" || href == "" ? 'html' : href);
182    var position = target.offset().top;
183    $("html, body").animate({scrollTop:position}, speed, "swing");
184    return false;
185  });
186});
187
188
189
190//--------------------------------------------------
191//   Accordion
192//--------------------------------------------------
193$(function(){
194  $("#page_feature_point .dl1 dt").click(function(){
195    $(this).next().slideToggle();
196    $(this).toggleClass("opened");
197  });
198});
199
200$(function(){
201  $(".accordion_list > *:nth-child(odd)").click(function(){
202    $(this).next().slideToggle();
203    $(this).toggleClass("opened");
204  });
205});
206
207
208
209//--------------------------------------------------
210//   PageTop
211//--------------------------------------------------
212$(function() {
213  var topBtn = $('.pagetop');	
214  topBtn.hide();
215  $(window).scroll(function () {
216    if ($(this).scrollTop() > 100) {
217      topBtn.fadeIn();
218    } else {
219      topBtn.fadeOut();
220    }
221  });
222  //スクロールしてトップ
223    topBtn.click(function () {
224    $('body,html').animate({
225      scrollTop: 0
226    }, 500);
227    return false;
228    });
229});
230
231
232
233//--------------------------------------------------
234//   Tab
235//--------------------------------------------------
236$(function() {
237	//クリックしたときのファンクションをまとめて指定
238	$('.tab_index li').click(function() {
239
240		//.index()を使いクリックされたタブが何番目かを調べ、
241		//indexという変数に代入します。
242		var index = $('.tab_index li').index(this);
243
244		//コンテンツを一度すべて非表示にし、
245		$('.tab_content .cassette').css('display','none');
246
247		//クリックされたタブと同じ順番のコンテンツを表示します。
248		$('.tab_content .cassette').eq(index).css('display','block');
249
250		//一度タブについているクラスselectを消し、
251		$('.tab_index li').removeClass('select');
252
253		//クリックされたタブのみにクラスselectをつけます。
254		$(this).addClass('select')
255	});
256});

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.