PageSourceSearch

https://www.mobit.ne.jp/company/common/js/script.js

js mobit.ne.jp collected 2026-09-24 09:20:58 UTC 5,392 bytes, 141 lines download raw bytes

1
2
3//ローカルファイルの置き場所(ルート)
4var local_root = "ssl-htdocs";
5//var local_root = "Documents";
6var rpath = "";
7if (window.location.href.indexOf("http") != 0) {
8	var point = window.location.href.indexOf(local_root);
9	rpath = window.location.href.substring(0,point) + local_root;
10	
11	$().ready(function(e) {
12		//Aタグにパス追加
13		var intv = setTimeout(function () {
14		$('a[href^="/"]:not([href^="//"])').each(function(index, element) {
15			var tmp = rpath + $(this).attr("href");
16			//alert(tmp);
17			$(this).attr("href",tmp);
18		});
19		$('[src^="/"]:not([src^="//"])').each(function(index, element) {
20			var tmp = rpath + $(this).attr("src");
21			//alert(tmp);
22			$(this).attr("src",tmp);
23		});
24		},500);
25	});
26}
27
28
29var ww; //window width
30var wh; //window height
31var smbcHeaderH //smbc header height
32$(function(){
33    setWindowSize(); // set smbcHeaderH
34    // 固定ヘッダ
35    //var smbcHeaderH = $('#smbcHeader').outerHeight(true);
36    var companyHeader = $('.sp-header-wrap');
37    var mainContents = $('#contents');
38    $(window).load(function(){
39        /*console.log(smbcHeaderH);
40        $(companyHeader).css('top', smbcHeaderH);
41        $(mainContents).css('margin-top', smbcHeaderH + 60);*/
42    });
43
44    /*var headerH = 60;
45    var mvHeight = 476; //MVの高さ
46    $(window).on("load", function(){
47        if(location.hash !== ""){
48            var targetOffset = $(location.hash).offset().top;
49            $(window).scrollTop(targetOffset - (headerH + smbcHeaderH));
50        }
51    });*/
52    // setWindowSize();
53    //3.Scroll
54    $(window).on('scroll', function () {
55        elmFadein(); //c-5.Element Fade In
56        //header固定 & pagetop btn
57        var mvHeight = 476;
58        if (smbcHeaderH < $(this).scrollTop()) {
59            $("body").addClass("header-fixed");
60        } else {
61            $("body").removeClass("header-fixed");
62        }
63        if (mvHeight < $(this).scrollTop()) {
64            $(".back-to-top-button").fadeIn("fast");
65        } else {
66            $(".back-to-top-button").fadeOut("fast");
67        }
68
69        /* 1-1.フッター上でのボタン停止処理 */
70        scrollHeight = $(document).height(); //ドキュメントの高さ
71        scrollPosition = $(window).height() + $(this).scrollTop(); //現在地
72        footHeight = $("footer").innerHeight(); //footerの高さ(=止めたい位置)
73        if (scrollHeight - scrollPosition <= footHeight) { //ドキュメントの高さと現在地の差がfooterの高さ以下になったら
74            $(".back-to-top-button").css({
75                "position": "absolute", //pisitionをabsolute(親:wrapperからの絶対値)に変更
76                "bottom": footHeight + 20 //下からfooterの高さ + 20px上げた位置に配置
77            });
78        } else { //それ以外の場合は
79            $(".back-to-top-button").css({
80                "position": "fixed", //固定表示
81                "bottom": "20px" //下から20px上げた位置に
82            });
83        }
84    });//End $(function())
85
86    // Humberger Menu
87    $(window).load(function(){
88        function menuSet(){
89            if(!($('.menu-wrap').length)){
90                $('.sp-header').prepend('<div class="menu-wrap"><div class="switch-btn-wrap"><a href="javascript:void(0);" class="switch-btn"><div class="humberger-border-1"></div><div class="humberger-border-2"></div><div class="humberger-border-3"></div></a></div><div class="menu-wrap"></div></div>');
91                var menuList = $('.global-navigation-list');
92                switchBtn = $('.switch-btn');
93                switchBtn.on('click', function(e){
94                    menuList.stop(false, false).slideToggle(300);
95                    $(this).toggleClass('close-btn');
96                    $('body').toggleClass('is-humberger-open');
97                });
98                $(".sp-header ul.global-navigation-list li ul li a").on('click', function (e) {
99                    menuList.stop(false, false).slideToggle(300);
100                    switchBtn.toggleClass('close-btn');
101                    $('body').toggleClass('is-humberger-open');
102                });
103            }
104        }
105        $(window).on('load resize', function(){
106            menuSet();
107        });
108        menuSet();
109    });
110
111    //4.読み込み完了時の処理
112    $(window).on('load', function () {
113        setWindowSize(); //c-4.set window size
114        setTimeout(function () {
115            elmFadein(); //c-5.Element Fade In
116        }, 1000);
117    });
118    function setWindowSize() {
119    //スクロールバーを除いたブラウザサイズの取得
120        ww = window.innerWidth ? window.innerWidth : $(window).width();
121        wh = window.innerHeight ? window.innerHeight : $(window).height();
122        smbcHeaderH = (ww * 0.293) / 220 * 91;
123        console.log("smbc:" + smbcHeaderH);
124    }
125    /*------------------------------------
126    c-5.Element Fade-in Animation
127    (.is-scroll要素に.is-show付与で表示)
128    ------------------------------------*/
129    function elmFadein() {
130        var elem = $('.is-scroll');
131        var isAnimate = 'is-show';
132        var scrollPos = $(window).scrollTop();
133        elem.each(function () {
134            var elemOffset = $(this).offset().top;
135            if (scrollPos > elemOffset - wh + (wh / 4)) {
136                $(this).addClass(isAnimate);
137            }
138        });
139    }
140
141});

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.