PageSourceSearch

https://www.anou-shoten.com/js/other/anchorlink.js

js anou-shoten.com collected 2026-10-07 23:23:20 UTC 1,447 bytes, 47 lines download raw bytes

1//header
2jQuery(function($){
3var marginTop = $(".header").height();
4  $(window).on("scroll", function() {
5    if ($(this).scrollTop() > 0) {
6      $(".header").addClass("fixed");
7      $("body").css("margin-top",marginTop+"px");
8    } else {
9      $(".header").removeClass("fixed");
10      $("body").css("margin-top","0px");
11    }
12  });
13});
14
15//#pagelink
16jQuery(function($){
17    var H_nav = $(".header").height();
18
19    function pagelink(heightnum) {
20        var headerH = heightnum;
21        $("a.anchorlink").click(function() {
22            var href = $(this).attr("href");
23            var target = $(href == "#" || href == "" ? "body" : href);
24            var position = target.offset().top - headerH;
25            $("html, body").animate({ scrollTop: position }, 500, "swing");
26            //return false;
27        });
28        /* outpagelink */
29        var url = $(location).attr("href");
30        if (url.indexOf("#") != -1) {
31            var url_sp = url.split("#");
32            var hash = "#" + url_sp[url_sp.length - 1];
33            var target = $(hash);
34            var position = target.offset().top - headerH;
35            $("html, body").animate({ scrollTop: position }, 500, "swing");
36
37        }
38    }
39    //条件が変わるようならココへ。
40    //            if($("body").hasClass("spn")){
41    //                pagelink(50);
42    //            }else{
43    //                pagelink(72);
44    //            }
45    pagelink(H_nav);
46});
47

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.