1$(document).ready(function() { 2 //--- 3 //ãµã¤ãããã®æ°è¦ç»é²ãã¿ã³åºå® 4 //--- 5 6 var fixedSidebar = (function() { 7 var navi, 8 naviHeight, 9 naviNextElement, 10 naviMarginTop, 11 naviMarginBottom, 12 naviPrevElementMargin, 13 naviHeightAll, 14 main, 15 mainHeight, 16 main_scroll, 17 fixed_start, 18 fixpx_end_top, 19 displayWidth, 20 tabletWidth; 21 return { 22 run : function() { 23 //ãã©ã¦ã¶å¹ ãåå¾ 24 displayWidth = $(window).width(); 25 26 // ãµã¤ããã¼ã®åºå®ããã¬ã¤ã¤ã¼ 27 navi = $('.side-contents_new-registration'); 28 29 // ãµã¤ããã¼ã®åºå®ããã¬ã¤ã¤ã¼ã®é«ããåå¾ 30 naviHeight = navi.height(); 31 32 // ãµã¤ããã¼ã®åºå®ããã¬ã¤ã¤ã¼ã®ä¸ã«ããè¦ç´ 33 naviNextElement = navi.next('div'); 34 35 // ãµã¤ããã¼ã®åºå®ããã¬ã¤ã¤ã¼ã®ãåºå®ãããã¨ãã®Margin-top 36 naviMarginTop = 60; 37 38 // ãµã¤ããã¼ã®åºå®ããã¬ã¤ã¤ã¼ã®margin-bottom 39 naviMarginBottom = 20; 40 41 42 // ãµã¤ããã¼ã®åºå®ããã¬ã¤ã¤ã¼ã®ä¸ã«ããè¦ç´ ã®margin-bottom 43 naviPrevElementMargin = 20; 44 45 // ã¡ã¤ã³ã®ãã¼ã¸ã³ãå«ããé«ã 46 naviHeightAll = naviHeight + naviMarginBottom + naviPrevElementMargin; 47 48 //ã¿ãã¬ããã®ãã¬ã¼ã¯ãã¤ã³ã 49 tabletWidth = 959; 50 51 //#main_columnããµã¤ããã¼ã«æ¯ã¹ã¦ä¸ã«é£ã³åºãã¦ããåãç¸æ®ºããé·ã 52 surplusMargin = 60; 53 54 main = $('#main_column'); 55 if(displayWidth > tabletWidth) { 56 this.refresh(); 57 } 58 59 }, 60 refresh : function() { 61 navi.css({ 62 position : 'relative', 63 top : 'auto' 64 }); 65 var navi_top = navi.offset().top - parseInt(navi.css('margin-top')); 66 var main_top = main.offset().top - parseInt(main.css('margin-top'))-surplusMargin; 67 // éå§ä½ç½®ï¼ããã®TOP 68 fixed_start = navi_top; 69 // ã¹ã¯ãã¼ã«ããä¸é 70 fixpx_end_top = main_top + main.outerHeight(true) - navi.outerHeight(true); 71 main_scroll = fixpx_end_top; 72 73 if (navi_top + navi.outerHeight(true) < main_top + main.outerHeight(true)) { 74 $(window).off('scroll', _onScroll).on('scroll', _onScroll); 75 } else { 76 $(window).off('scroll', _onScroll); 77 } 78 $(window).trigger('scroll'); 79 }, 80 removeStyle : function() { 81 navi.css({ 82 position : 'static' 83 }); 84 $(window).off('scroll', _onScroll); 85 } 86 }; 87 88 function _onScroll() { 89 var fix_end_value = 1100; 90 //ãµã¤ããã¼ã®ä¸ã®ä½ãã¯ã»ã«ããç»é²ã¨ãªã¢ãååºç¾ããã 91 var ws = $(window).scrollTop() - fix_end_value; 92 if (ws > fixpx_end_top - fix_end_value) { 93 // åºå®ããä¸é 94 navi.css({ 95 position : 'fixed', 96 top : (fixpx_end_top - ws) - naviMarginTop - fix_end_value + 'px' 97 }); 98 } else if (ws > fixed_start) { 99 // åºå®ä¸é 100 navi.css({ 101 position : 'fixed', 102 top : naviMarginTop + 'px' 103 }); 104 naviNextElement.css({ 105 marginTop : naviHeightAll + 'px' 106 }); 107 } else { 108 //ãåºå®éå§ã¾ã§ 109 navi.css({ 110 position : 'relative', 111 top : '0px' 112 }); 113// setTimeout(function(){ 114// navi.css({ 115// position : 'relative' 116// //top : '0px' 117// }); 118// },200); 119 naviNextElement.css({ 120 marginTop : '0px' 121 }); 122 } 123 } 124 125 function removeStyle() { 126 navi.css({ 127 position : 'relative', 128 top : '0px' 129 }); 130 } 131})(); 132 133 $(window).on('load resize', function(){ 134 //ãã©ã¦ã¶å¹ ãåå¾ 135 var displayWidth = $(window).width(); 136 137 //ã¿ãã¬ããã®ãã¬ã¼ã¯ãã¤ã³ã 138 var tabletWidth = 959; 139 140 141 //PCã¨ã¢ãã¤ã«ã®æååãæ¿ã 142 //--PC 143 if(displayWidth > tabletWidth) { 144 fixedSidebar.run(); 145 146 //--ã¢ãã¤ã« 147 } else { 148 fixedSidebar.removeStyle(); 149 } 150 }); 151 152});
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.