PageSourceSearch

https://www.yuzawacorp.jp/js/scroller.js

js yuzawacorp.jp collected 2026-10-07 06:16:43 UTC 2,037 bytes, 42 lines download raw bytes

1// 参考:http://sterfield.co.jp/designer/ページリンク付きのアンカーリンクに対応したjquery/
2$(window).load(function(){
3//$(function(){
4	//.noScrollは除外
5    $('a[href*=#], area[href*=#]').not(".noScroll,.XXXX").click(function() {
6 
7        var speed = 400, // ミリ秒(この値を変えるとスピードが変わる)
8            href = $(this).prop("href"), //リンク先を絶対パスとして取得
9            hrefPageUrl = href.split("#")[0], //リンク先を絶対パスについて、#より前のURLを取得
10            currentUrl = location.href, //現在のページの絶対パスを取得
11            currentUrl = currentUrl.split("#")[0]; //現在のページの絶対パスについて、#より前のURLを取得
12 
13        //#より前の絶対パスが、リンク先と現在のページで同じだったらスムーススクロールを実行
14        if(hrefPageUrl == currentUrl){
15 
16            //リンク先の#からあとの値を取得
17            href = href.split("#");
18            href = href.pop();
19            href = "#" + href;
20 
21            //スムースクロールの実装
22            var target = $(href == "#" || href == "" ? 'html,body' : href),
23                position = target.offset().top //targetの位置を取得
24//                body = 'body',
25//                userAgent = window.navigator.userAgent.toLowerCase();
26//            if (userAgent.indexOf('msie') > -1 || userAgent.indexOf('trident') > -1 || userAgent.indexOf("firefox") > -1 ) { /*IE8.9.10.11*/
27//                body = 'html';
28//            }
29            $('html,body').animate({
30                scrollTop: position
31            }, speed, 'swing', function() {
32                //スムーススクロールを行ったあとに、アドレスを変更(アドレスを変えたくない場合はここを削除)
33                if(href != "#top" && href !="#") {
34                    location.href = href; 
35                }
36            });
37 
38            return false;
39        }
40 
41    });
42});

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.