1$(function(){ 2 3 let header = $('#g-header'); 4 let headerHeight = header.outerHeight(); 5 $(window).on('resize', function (){ 6 headerHeight = header.outerHeight(); 7 }); 8 9 // ã¢ã³ã«ã¼ã¹ã¯ãã¼ã« 10 let speed = 300; 11 let hash = $(location.hash); 12 let exclusion = headerHeight + 10; // ã¹ã¯ãã¼ã«å ããé¤å¤ããå¤ 13 if(hash.length){ 14 $('html, body').animate({scrollTop: hash.offset().top - exclusion}, speed, 'swing'); 15 } 16 $('a.back-to-top, a[href*="#"]').not('[href="#"]').on('click', function(){ 17 let href = $(this).attr('href').replace('/', ''); 18 if(href.length !== 0){ 19 let target = $(href === '#' || href === '' ? 'html' : href); 20 let position = target.offset().top - exclusion; 21 $('html, body').animate({scrollTop: position}, speed, 'swing'); 22 } 23 return false; 24 }); 25 26 // 表示ä¸ã®ãã¼ã¸ã¨ããã²ã¼ã·ã§ã³ãªã³ã¯ã®ä¸è´ç¢ºèª 27 let requestURI = location.pathname; 28 $('#g-header ul.navigation > li, #sp-navigation .navbar-nav').each(function(i, el){ 29 $(el).find('a').each(function(){ 30 let href = $(this).attr('href'); 31 let naviDir = '/' + href // ãªã³ã¯ãããã¹é¨åãæ½åº 32 .replace(/^.+:\/\//, '') // ãããã³ã«è¡¨è¨åé¤ 33 .split('/') // ãã£ã¬ã¯ããªã®ããªãã¿ã§åºåãé åå 34 .filter(Boolean) // 空ç½åé¤ 35 .filter(function(e){return e !== location.hostname}) // ãã¹ãé¨åãåé¤ 36 .join('/') // æååã¨ãã¦é£çµ 37 .split('#') // ããã·ã¥ã®ããªãã¿ã§åºåãé åå 38 .shift() // æåã®è¦ç´ ï¼ããã·ã¥ä»¥å¤ï¼ãæååã¨ãã¦è¿ã 39 ; 40 if(href === requestURI || naviDir === requestURI || (naviDir !== '' && naviDir !== '/' && location.pathname.indexOf(naviDir) !== -1)){ 41 $(this).addClass('current'); 42 return false; 43 } 44 }); 45 }); 46 47 /* Sticky Header */ 48 let body = $('body'); 49 let fixedClass = 'sticky'; 50 let headerPosition; 51 let scrollPosition = 0; 52 let scrollDiff = 0; 53 // let buffer = 0; 54 let heightAdjust; 55 56 $(window).on('load', function (){ 57 headerPosition = header.offset().top + headerHeight; 58 if(headerPosition <= $(window).scrollTop()){ 59 body.addClass(fixedClass); 60 } 61 62 heightAdjust = $(document).height()/headerPosition; // ããã¥ã¡ã³ãã®é«ãã¨ãããã®é«ãã®å²åï¼ä¿æ°ï¼ 63 }); 64 65 $(window).on('scroll', function(){ 66 if(!$('.sp.navbar .navbar-toggler').hasClass('collapsed')){ // ã¹ããã¡ãã¥ã¼è¡¨ç¤ºæã¯ã¹ããã 67 return; 68 } 69 70 // ã¹ã¯ãã¼ã«å·®ååå¾ 71 if(scrollPosition !== 0){ // ã¹ã¯ãã¼ã«ç¶ç¶æ 72 scrollDiff = scrollPosition - $(window).scrollTop(); 73 } 74 scrollPosition = $(window).scrollTop(); 75 76 let headerPositionAdjusted = headerPosition; 77 if(scrollDiff > 0){ // ã¹ã¯ãã¼ã«ãä¸ããä¸ã¸æ»ãã±ã¼ã¹ 78 // headerPositionãèª¿æ´ 79 headerPositionAdjusted = headerPosition - 160; 80 } 81 82 // ã¹ã¯ãã¼ã«éåº¦ä¿æ°ããè¨å® 83 // buffer = heightAdjust*(Math.abs(scrollDiff)); // ã¹ã¯ãã¼ã«å·®åã¯çµ¶å¯¾å¤ã«å¤æãã¦ããç®åº 84 85 // Sticky classè¨å® 86 if(0 === scrollPosition || (0 <= scrollPosition && scrollPosition <= headerPositionAdjusted)){ 87 body.removeClass(fixedClass+'-on').removeClass(fixedClass); 88 } 89 else if( 90 headerPositionAdjusted < scrollPosition // ã¹ã¯ãã¼ã«ä½ç½®ãããã調æ´ç¯å²ãã大ãã 91 && headerPosition < scrollPosition // ã¹ã¯ãã¼ã«ä½ç½®ããããç¯å²ãã大ãã 92 // && scrollPosition < headerPositionAdjusted + buffer // ã¹ã¯ãã¼ã«ä½ç½®ãããã調æ´ç¯å²+ãããã¡ããå°ãã 93 ){ 94 body.addClass(fixedClass); 95 } 96 }); 97 98 // sticky-onã¯ã©ã¹ãä»ä¸ ï¼ç»é¢éä¸ã§ãªãã¼ããããå ´åãè¥å¹²ã®ãã£ã¬ã¤å¾ã«ããããè¡¨ç¤ºï¼ 99 setInterval(function(){ 100 if(headerPosition <= $(window).scrollTop() && !body.hasClass(fixedClass+'-on')){ 101 body.addClass(fixedClass+'-on'); 102 } 103 },800); 104 105 // Back to Top 106 let backToTop = $('.back-to-top'); 107 backToTop.hide(); 108 $(window).on("scroll", function(){ 109 // ã¹ã¯ãã¼ã«ä½ç½®ã以ä¸ãããå°ããå ´åã«ä»¥ä¸ã®å¦çããã 110 if($(this).scrollTop() > 500){ 111 // (å°ããæã¯)ãã¼ã¸ããããã¿ã³ããã§ã¼ãã¤ã
111³ 112 backToTop.fadeIn(500, 'swing'); 113 } 114 else{ 115 // ãã以å¤ã®å ´åã®å ´åã¯ãã§ã¼ãã¢ã¦ãããã 116 backToTop.fadeOut(800, 'linear'); 117 } 118 }); 119 120 // ããã¿ã¼åºå® 121 $(window).on("scroll", function(){ 122 // ããã¥ã¡ã³ãã®é«ã 123 let scrollHeight = $(document).height(); 124 // ã¦ã£ã³ãã¦ã®é«ã+ã¹ã¯ãã¼ã«ããé«ã â ç¾å¨ã®ãããããã®ä½ç½® 125 scrollPosition = $(window).height() + $(window).scrollTop(); 126 // ããã¿ã¼ + padding + border ã®é«ã 127 let footHeight = $("#g-footer").height(); 128 // ç¾å¨ã®ä¸ããä½ç½®ããããã¿ã¼ã®é«ãã®ä½ç½®ã«ã¯ãã£ãã 129 if(scrollHeight - scrollPosition <= footHeight ){ 130 // ".back-to-top"ã®positionãabsoluteã«å¤æ´ããããã¿ã¼ã®é«ãã®ä½ç½®ã«ãã 131 // "bottom"ã®æå®ã¯è¦ªè¦ç´ ããã¿ãæ°å¤ã«ããã¦ä¸ãã 132 backToTop.css({ 133 "position": "absolute", 134 "bottom": "-10px", 135 "right": "30px", 136 }).removeClass(fixedClass+'-fixed'); 137 } 138 else { 139 // ãã以å¤ã®å ´åã¯å ã®cssã¹ã¿ã¤ã«ãæå® 140 backToTop.css({ 141 "position":"fixed", 142 "right": "30px", 143 "bottom": "10px" 144 }).addClass(fixedClass+'-fixed'); 145 } 146 }); 147 148});
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.