PageSourceSearch

https://tansho.jp/js/utils.js

js tansho.jp collected 2026-10-05 11:18:21 UTC 2,093 bytes, 78 lines download raw bytes

1// JavaScript Document
2
3//スムーススクロールの処理
4//==========================================================================================
5$(function(){
6
7  //スムーススクロールの処理
8  $(".smoothScrolls a").click(function(e) {
9    e.preventDefault();
10    var tt = $($(this).attr("href")).offset().top;
11    $('html, body').animate({scrollTop:tt}, 300);
12  });
13  
14})
15
16// お知らせ
17jQuery(document).ready( function() {
18  $('.notice_frame .news_body').slice(0, 3).addClass("open");
19  $('.notice_frame .news_title').slice(0, 3).addClass("open");  
20  $('.notice_frame .news_title').slice(3, 999).addClass("close");  
21  $('.notice_frame .news_title').click(function(){
22    $(this).toggleClass("close").next('.index .news_body').slideToggle();
23  });
24  
25});
26
27
28//上に残る
29//==========================================================================================
30$(function() {
31    var nav_bar = $('.nav_contact');
32    //navの位置    
33    var navTop = nav_bar.offset().top;
34    //スクロールするたびに実行
35    $(window).scroll(function () {
36        var winTop = $(this).scrollTop();
37        //スクロール位置がnavの位置より下だったらクラスfixedを追加
38        if (winTop > navTop) {
39            nav_bar.addClass('nav_add');
40        } else if (winTop <= navTop) {
41            nav_bar.removeClass('nav_add')
42        }
43    });
44});
45
46
47//モーダルウィンドウ
48//==========================================================================================
49$(document).ready(function() {
50  var $bg = $('#modal_bg');
51  var $modal = $('#modal');
52  $bg.click(modal_close);
53
54  var $close = $('#modal_close');
55  $close.click(modal_close);
56
57  function modal_close() {
58    $modal.hide();
59    $bg.hide();
60  }
61
62  if (!sessionStorage.getItem('acs2')) {
63    $modal.show();
64    $bg.show();
65  }
66
67  $('[name="acs_next"]').change(function() {
68    if ($(this).is(':checked')) {
69      sessionStorage.setItem('acs2', 'on');
70    }else {
71    sessionStorage.removeItem('acs2');
72  }
73  });
74
75  if (sessionStorage.getItem('acs2')) {
76    modal_close();
77  }
78});

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.