PageSourceSearch

https://hyakka-ryouran.jp/js/common.js

js hyakka-ryouran.jp collected 2026-10-07 03:11:46 UTC 3,960 bytes, 135 lines download raw bytes

1// PAGETOP
2$(document).ready(function(){
3  $(".footer-top__link").hide();
4  $(function () {
5    var pagetop = $('.footer-top__link');
6    $(window).scroll(function () {
7      if ($(this).scrollTop() > 100) {
8        pagetop.addClass('footer-top__show');
9      } else {
10        pagetop.removeClass('footer-top__show');
11      }
12    });
13    $(window).bind("scroll", function() {
14      scrollHeight = $(document).height();
15      scrollPosition = $(window).height() + $(window).scrollTop();
16      footHeight = $("footer").innerHeight();
17      if ( scrollHeight - scrollPosition  <= footHeight ) {
18        $(".footer-top__link").css({
19          "position":"absolute",
20          "display":"block",
21          "bottom": footHeight+10
22        });
23      } else {
24        $(".footer-top__link").css({
25          "position":"fixed",
26          "display":"block",
27          "bottom": 10,
28        });
29      }
30    });
31  });
32});
33//footer-floatingmenu
34$(document).ready(function(){
35  $(".footer-floatingmenu__list").hide();
36  $(function () {
37    var pagetop = $('.footer-floatingmenu__list');
38    $(window).scroll(function () {
39      if ($(this).scrollTop() > 200) {
40        pagetop.addClass('footer-floatingmenu__list--show');
41      } else {
42        pagetop.removeClass('footer-floatingmenu__list--show');
43      }
44    });
45    $(window).bind("scroll", function() {
46      scrollHeight = $(document).height();
47      scrollPosition = $(window).height() + $(window).scrollTop();
48      footHeight = $("footer").innerHeight();
49      if ( scrollHeight - scrollPosition  <= footHeight ) {
50        $(".footer-floatingmenu__list").css({
51          "position":"absolute",
52          "display":"block",
53          "bottom": 0,
54        });
55      } else {
56        $(".footer-floatingmenu__list").css({
57          "position":"fixed",
58          "display":"block",
59          "bottom": 0,
60        });
61      }
62    });
63  });
64});
65//footer-floatingmenu__bg
66$(document).ready(function(){
67  $(".footer-floatingmenu__bg").hide();
68  $(function () {
69    var pagetop = $('.footer-floatingmenu__bg');
70    $(window).scroll(function () {
71      if ($(this).scrollTop() > 200) {
72        pagetop.addClass('footer-floatingmenu__bg--show');
73      } else {
74        pagetop.removeClass('footer-floatingmenu__bg--show');
75      }
76    });
77    $(window).bind("scroll", function() {
78      scrollHeight = $(document).height();
79      scrollPosition = $(window).height() + $(window).scrollTop();
80      footHeight = $("footer").innerHeight();
81      if ( scrollHeight - scrollPosition  <= footHeight ) {
82        $(".footer-floatingmenu__bg").css({
83          "position":"absolute",
84          "display":"block",
85          "bottom": 0,
86        });
87      } else {
88        $(".footer-floatingmenu__bg").css({
89          "position":"fixed",
90          "display":"block",
91          "bottom": 0,
92        });
93      }
94    });
95  });
96});
97// SMOOTH SCROLL
98$(function(){
99  $('a[href^="#"]').click(function(){
100    var speed = 500;
101    var href= $(this).attr("href");
102    var target = $(href == "#" || href == "" ? 'html' : href);
103    var position = target.offset().top;
104    $("html, body").animate({scrollTop:position}, speed, "swing");
105    return false;
106  });
107});
108
109// IMAGE SWITCH
110$(function() {
111  var $elem = $('.js-switch');
112  var sp = '_sp.';
113  var pc = '_pc.';
114  var replaceWidth = 991;
115
116  function imageSwitch() {
117    var windowWidth = parseInt(window.innerWidth);
118    $elem.each(function() {
119      var $this = $(this);
120      if(windowWidth >= replaceWidth) {
121        $this.attr('src', $this.attr('src').replace(sp, pc));
122      } else {
123        $this.attr('src', $this.attr('src').replace(pc, sp));
124      }
125    });
126  }
127  imageSwitch();
128  var resizeTimer;
129  $(window).on('resize', function() {
130    clearTimeout(resizeTimer);
131    resizeTimer = setTimeout(function() {
132      imageSwitch();
133    }, 200);
134  });
135});

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.