1jQuery(function ($) { 2 function setHeaderColor() { //设置头é¨èæ¯è²éæç½è²å 3 $('#navbar').addClass('scroll-show') 4 $('#button_enter .btn').css({ 5 'color': '#fff', 6 'border-right': '1px solid #fff' 7 }) 8 9 } 10 11 // pic卿 12 var waveObj = {}, 13 indexWaveObj = {}; 14 $('body').ready(function () { //页é¢å·æ°æ¶ä¹åçæ»å¨ä½ç½®çæ ·å¼è®¾ç½® 15 var scrollTop = $(window).scrollTop(); 16 if (window.menuId !== 'map' 17 && window.menuId !== 'news' 18 && window.menuId !== 'download' 19 && window.menuId !== 'error') { 20 if (scrollTop > 0) { 21 22 $('#navbar').removeClass('top-show').addClass('scroll-show') 23 $('#button_enter .btn').css({ 24 'color': '#1B2733', 25 'border-right': '1px solid #1B2733' 26 }) 27 28 } else { 29 setHeaderColor() 30 } 31 } else {//æ°é»é¡µãä¸è½½é¡µç½è²èæ¯é»è²åé»è²logo 32 $('#navbar').removeClass('top-show').addClass('scroll-show') 33 34 $('#button_enter .btn').css({ 35 'color': '#1B2733', 36 'border-right': '1px solid #1B2733' 37 }) 38 } 39 40 var waves = $('.micro-wave'), 41 wavesLength = waves.length; 42 if (wavesLength > 0) { 43 for (var i = 0; i < wavesLength; i++) { 44 waveObj['img' + i] = waves[i]; 45 } 46 } 47 48 // é对é¦é¡µç¹æ®å¤ç卿 49 var indexWaves = $('.micro-wave-index'), 50 indexWavesLength = indexWaves.length; 51 if (indexWavesLength > 0) { 52 for (var i = 0; i < indexWavesLength; i++) { 53 indexWaveObj['block' + i] = indexWaves[i]; 54 } 55 } 56 animateIndex(scrollTop) 57 // å»¶è¿å å ¥æè½¨å¨æ 58 setTimeout(insertStarAnimation, 2000); 59 }); 60 // è¡¥å 导èªfix导è´çå°äº1200æ æ³æ¨ªåæ»å¨ 61 window.onscroll = function(){ 62 ããvar sl = -Math.max(document.body.scrollLeft,document.documentElement.scrollLeft); 63 ããdocument.getElementById("navbar").style.left = sl + 'px'; //éæ°è®¾ç½®æ¨ªåæ»å¨æ¡ä½ç½® 64 } 65 var scrollFlag = true; 66 $(window).scroll(function () { 67 var scrollTop = $(window).scrollTop(); 68 animate(scrollTop) 69 animateIndex(scrollTop) 70 if (scrollTop > 0) { //æ»å¨æ¶ç½è²èæ¯é»è²åé»è²logo 71 if (!scrollFlag) return; 72 $('#navbar').removeClass('top-show').addClass('scroll-show') 73 $('#button_enter .btn').css({ 74 'color': '#1B2733', 75 'border-right': '1px solid #1B2733' 76 }) 77 scrollFlag = false; 78 } else { 79 if (window.menuId !== 'map' 80 && window.menuId !== 'news' 81 && window.menuId !== 'download' 82 && window.menuId !== 'error') { 83 //æ°é»é¡µãä¸è½½é¡µæ»å¨å°é¡¶ä¿æç½è²èæ¯é»è²åé»è²logo 84 // $('#navbar').removeClass('scroll-show').addClass('top-show') 85 } 86 scrollFlag = true; 87 } 88 }); 89 90 function animate(scrollTop) { 91 Object.keys(waveObj).forEach(function (t) { 92 var offsetTop = getPosition(waveObj[t]).top 93 scrollTop + document.body.clientHeight >= offsetTop && scrollTop + document.body.clientHeight < offsetTop + waveObj[t].clientHeight && $(waveObj[t]).addClass('wave-up'); 94 scrollTop + document.body.clientHeight < offsetTop && $(waveObj[t]).removeClass('wave-up'); 95 }) 96 } 97 function animateIndex(scrollTop) { 98 Object.keys(indexWaveObj).forEach(function (t) { 99 if ($(indexWaveObj[t]).hasClass('active')) { return; } 100 var offsetTop = getPosition(indexWaveObj[t]).top; 101 // distance:å¼å§å¨ç»çä½ç½® 102 var distance = document.body.clientHeight / 2; 103 scrollTop + distance >= offsetTop && scrollTop + distance < offsetTop + indexWaveObj[t].clientHeight && $(indexWaveObj[t]).addClass('active'); 104 }) 105 } 106 107 108 function getPosition(obj) { 109 var left = 0; 110 var top = 0; 111 while (obj.offsetParent) { 112 left += obj.offsetLeft; 113 top += obj.offsetTop; 114 obj = obj.offsetParent; 115 } 116 return { 'left': left, 'top': top } 117 } 118 119 function insertStarAnimation() { 120 var tpl = '<div class="star">' + 121 '<img class="bg" src="/public/images/indexactive/star-bg.svg">' + 122 '<img class="inner" src="/public/images/indexactive/star-inner.svg">' + 123 '<img class="mid" src="/public/images/indexactive/star-mid.svg">
123' + 124 '<img class="outer" src="/public/images/indexactive/star-outer.svg">' + 125 '</div>' 126 // $('.header-img').prepend($(tpl)); 127 if( getCookie('language')=== 'zh'){ 128 $('.main-banner').prepend($(tpl)); 129 setTimeout(function () { 130 $('.main-banner .star').addClass('rotate'); 131 setTimeout(function () { 132 $('.main-banner .star').fadeIn(5000); 133 }, 300) 134 }, 0) 135 }else{ 136 $('.header-img').prepend($(tpl)); 137 setTimeout(function () { 138 $('.header-img .star').addClass('rotate'); 139 setTimeout(function () { 140 $('.header-img .star').fadeIn(5000); 141 }, 300) 142 }, 0) 143 } 144 145 146 } 147 function getCookie(c_name) { 148 if (document.cookie.length > 0) { 149 c_start = document.cookie.indexOf(c_name + "=") 150 if (c_start != -1){ 151 c_start = c_start + c_name.length + 1 152 c_end = document.cookie.indexOf(";", c_start) 153 if (c_end == -1) 154 c_end = document.cookie.length 155 return unescape(document.cookie.substring(c_start, c_end)) 156 } 157 } 158 return "" 159 } 160})
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.