1( function( $ ) { 2 $.fixedScroll = function ( box, options ) 3 { 4 5 var agent = navigator.userAgent; 6 var isIE6 = false; 7 8 box = $( box ); 9 box.justify = ''; 10 11 12 if ( options.container && options.container != '') 13 { 14 box.cont = $( '#' + options.container ); 15 } 16 else 17 { 18 box.cont = box.parent(); 19 } 20 21 if ( options.startNum && options.startNum != '') 22 { 23 box.startNum = options.startNum ; 24 25 } 26 else 27 { 28 box.startNum = 0; 29 } 30 31 if ( options.num && options.num != '') 32 { 33 box.num = options.num ; 34 } 35 else 36 { 37 box.num = 0; 38 } 39 40 if ( options.endNum && options.endNum != '') 41 { 42 box.endNum = options.endNum ; 43 } 44 else 45 { 46 box.endNum = 0; 47 } 48 49 if( options.justify != '' ) 50 { 51 box.justify = $( '#' + options.justify ); 52 box.justify.margin = ( parseInt( box.justify.css( 'marginTop' ) ) || 0 ) + ( parseInt( box.justify.css( 'marginBottom' ) ) || 0 ); 53 } 54 if (agent.indexOf('MSIE') != -1){ 55 var ver = Number ( agent.substring((agent.indexOf('MSIE') + 5), (agent.indexOf('MSIE') + 8)) ); 56 if(ver <= 6) isIE6 = true; 57 } 58 59 var parentTop = box.cont.offset().top; 60 61 var parentHeight = box.cont.height() - ( box.outerHeight(true) + box.num ); 62 if ( options.containerHeight && options.containerHeight != '') 63 { 64 parentHeight = options.containerHeight; 65 } 66 var parentBoxHeight = box.parent().get(0).offsetHeight; 67 var leftMargin = box.offset().left - box.cont.offset().left; 68 69 if($('div').hasClass('box_gradeList')){ 70 box.offsetTop = box.cont.offset().top; 71 }else{ 72 box.offsetTop = box.offset().top; 73 } 74 75 box.margin = ( parseInt( box.css( 'marginTop' ) ) || 0 ) + ( parseInt( box.css( 'marginBottom' ) ) || 0 ); 76 box.innerTop = box.offsetTop - parentTop; 77 78 $(window).load(function (){ 79 scr(); 80 }); 81 82 $( window ).scroll( function (){ 83 scr(); 84 }); 85 86 $( window ).resize( function (){ 87 scr(); 88 }); 89 90 $( document ).bind( 'boxchanged', function ( event ){ 91 scr(); 92 }); 93 94 function scr() 95 { 96 var diff = 0; 97 var pageScrollTop = $( window ).scrollTop(); 98 var boxHeight = parseInt( box.get(0).offsetHeight ) + box.margin; 99 if( box.justify != '' ){ 100 var justify = parseInt( box.justify.get(0).offsetHeight + box.justify.margin ); 101 diff = justify - boxHeight ; 102 if( diff > parentBoxHeight ) diff = 0; 103 } 104 105 if ( box.offsetTop - box.startNum > pageScrollTop ) 106 { 107 box.css({ 108 'position': "absolute", 109 'top': "0px", 110 'left': "0px" 111 }); 112 } 113 else if( ( boxHeight + pageScrollTop + diff ) < ( parentTop + parentHeight ) ) 114 { 115 if(!isIE6){ 116 var boxLeft = box.cont.offset().left + leftMargin ; 117 var scrLeft = $( window ).scrollLeft() ; 118 box.css({ 119 'position': "fixed", 120 'top': "0px", 121 'left': ( boxLeft - scrLeft ) + "px" 122 }); 123 } 124 else{ 125 box.css({ 126 'position': "absolute", 127 'top': ( pageScrollTop - box.offsetTop ) + "px", 128 'left': "0px", 129 'z-index': 9999 130 }); 131 } 132 } 133 else 134 { 135 box.css({ 136 'position': "absolute", 137 'top': ( parentHeight - ( boxHeight + diff + box.endNum ) ) + "px", 138 'left': "0px" 139 }); 140 } 141 }; 142 scr(); 143 144 145 }; 146 147 $.fn.fixedScroll = function ( options ) 148 { 149 options = options || {}; 150 options.container = options.container || ''; 151 options.justify = options.justify || ''; 152 153 this.each( function() 154 { 155 new $.fixedScroll( this, options ); 156 } 157 ); 158 159 return this; 160 }; 161 162})( jQuery ); 163 164 165 166
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.