PageSourceSearch

https://www.gifucvb.or.jp/convention/js/smoothScroll.js

js gifucvb.or.jp collected 2026-10-02 09:56:30 UTC 3,473 bytes, 77 lines download raw bytes

1$(function(){
2  $('a[href^="#"]').click(function(){
3    var speed = 500;
4    var href= $(this).attr("href");
5    var headerHight = $(".global-nav-wrap").height(); //ヘッダの高さ
6	//モーダルウィンドウの#リンクのみ起動しない
7	if( href.indexOf('doui') > -1||href.indexOf('chara1') > -1 ||href.indexOf('chara2') > -1||href.indexOf('kakudai1') > -1 ||href.indexOf('kakudai2') > -1 ){
8    }else if( href.indexOf('top') > -1 ){
9	//ページ上部へ
10		var target = $(href == "#" || href == "" ? 'html' : href);
11		$("html, body").animate({scrollTop:0}, speed, "swing");
12		return false;
13	}else{
14	//著作権同以外の#リンクのみ起動
15		var target = $(href == "#" || href == "" ? 'html' : href);
16		var position = target.offset().top-headerHight; 
17		$("html, body").animate({scrollTop:position}, speed, "swing");
18		return false;
19	}
20  });
21});
22//▼別ページからのリンクで高さ調整
23$(function() {
24  var headerHight = $(".global-nav-wrap").height(); //ヘッダの高さ
25  var url = location.href;
26  if(url.match("#")) {
27  var str = location.href ;
28  var cut_str = "#";
29  var index = str.indexOf(cut_str);
30  var href = str.slice(index);
31  var target = href;
32  var position = $(target).offset().top - headerHight;
33  $("html, body").scrollTop(position);
34  return false;
35  }
36});
37//pagetop-btn
38$('.pagetop-btn').css("opacity", "0");
39$('.pagetop-btn').css("visibility", "hidden");
40$(window).scroll(function() {
41	 $(window).on('load scroll resize',function(){
42		var scrollHeight = $(document).height(); //ドキュメントの高さ
43        var scrollPosition = $(window).height() + $(window).scrollTop(); //現在地
44        var footHeight = $('footer').innerHeight(); //footerの高さ(=止めたい位置)
45        if ( scrollHeight - scrollPosition  <= footHeight ) { //ドキュメントの高さと現在地の差がfooterの高さ以下になったら
46			$('.pagetop-btn').removeClass('fixed');
47			$('.pagetop-btn').addClass('abs');
48        } else { //それ以外の場合は
49			$('.pagetop-btn').addClass('fixed');
50			$('.pagetop-btn').removeClass('abs');
51        }
52        //スクロールが100に達したら
53		if ($(this).scrollTop() > 100) {
54			$("h1.logo .logo-scroll-box").addClass("logo-block");//ロゴの調整
55			$("h1.logo .logo-scroll-box").removeClass("logo-none");//ロゴの調整
56			$("h1.logo .logo-long-box").addClass("logo-none");//ロゴの調整
57			$("h1.logo .logo-long-box").removeClass("logo-block");//ロゴの調整
58			$(".nav-other-pc").addClass("d-xl-none");//メニュー一部非表示
59			$(".nav-other-pc").removeClass("d-xl-block");//メニュー一部非表示
60			$(".global-nav").addClass("fix");//コンベンションのみ微調整
61			//表示
62			$('.pagetop-btn').css("opacity", "1");
63			$('.pagetop-btn').css("visibility", "visible");
64		} else {
65			$("h1.logo .logo-scroll-box").addClass("logo-none");//ロゴの調整
66			$("h1.logo .logo-scroll-box").removeClass("logo-block");//ロゴの調整
67			$("h1.logo .logo-long-box").addClass("logo-block");//ロゴの調整
68			$("h1.logo .logo-long-box").removeClass("logo-none");//ロゴの調整
69			$(".nav-other-pc").addClass("d-xl-block");//メニュー一部非表示
70			$(".nav-other-pc").removeClass("d-xl-none");//メニュー一部非表示
71			$(".global-nav").removeClass("fix");//コンベンションのみ微調整
72			//非表示
73			$('.pagetop-btn').css("opacity", "0");
74			$('.pagetop-btn').css("visibility", "hidden");
75		}
76	});
77});

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.