1!(function (window, document) { 2 /*äºçº§è·³è½¬è³ç§»å¨ç«¯*/ 3 // return 4 var location = window.location.href, //宿´é¾æ¥ 5 pageName = location.substr(location.lastIndexOf('/') + 1), //页é¢åç§° 6 isIndex = 7 pageName == '' || 8 pageName == 'home.htm' || 9 pageName == 'index.htm'|| //æ¯å¦é¦é¡µ 10 pageName == 'index.html', //æ¯å¦é¦é¡µ 11 isMobile = 12 window.navigator.userAgent.toLowerCase().indexOf('mobile') > 0 13 ? true 14 : false, //æ¯å¦ç§»å¨ç«¯ 15 m_url = '' 16 if (isMobile) { 17 if (isIndex) { 18 m_url = 19 location.substr(0, location.lastIndexOf('/') + 1) + 20 'mobile/index_m.htm' 21 } else { 22 if (pageName == 'xhwlyzb.htm') return //è·¯æ¼ç°åº 23 24 m_url = 25 location.substr(0, location.lastIndexOf('/') + 1) + 26 'mobile/' + 27 pageName.substr(0, pageName.indexOf('.')) + 28 '_m.htm' 29 } 30 window.location.href = m_url 31 } else { 32 return 33 } 34})(window, document) 35!(function (window, document) { 36 /*导èªäº¤äº*/ 37 var $nav = $('.nav'), 38 $main_box = $nav.find('.nav-main-item'), //主导èªaç¶çº§ 39 $main_a = $main_box.find('.nav-main-items'), //主导èªa 40 $main_bg = $main_box.find('.nav-bg'), //èæ¯å¾ 41 $sub_nav = $nav.find('.sub-nav'), //å¯å¯¼èª 42 $sub_nav_box = $sub_nav.find('.sub-nav-box'), //å¯å¯¼èªbox 43 $sub_nav_item = $sub_nav.find('.sub-nav-item'), //å¯å¯¼èªaç¶çº§ 44 $sub_a = $sub_nav.find('.sub-nav-items'), //å¯å¯¼èªa 45 $sub_bg = $sub_nav.find('.sub-nav-bg'), 46 $onWhichPage = $nav.find('.nav-on'), //å½å页,é¢ç--- 47 main_box = document.querySelector('.nav-main-item'), 48 main_a = document.querySelectorAll('.nav-main-items'), //主导èªa 49 sub_a = document.querySelectorAll('.sub-nav-items'), //å¯å¯¼èªa 50 sub_nav_box = document.querySelector('.sub-nav-box'), //å¯å¯¼èªbox 51 sub_nav_item = document.querySelectorAll('.sub-nav-item'), //å¯å¯¼èªaç¶çº§ 52 main_a_len = main_a.length, 53 pageHref = window.location.href, 54 isIe8 = 55 window.navigator.userAgent.toLowerCase().indexOf('msie 8') != -1 56 ? true 57 : false, 58 arrW = [], 59 offsetx = 52, //对åºaæ ç¾çmarginå¼; 60 oldIndex = -1, 61 newIndex = 0, 62 _timer = null, 63 isIndex0 = true, 64 isSubExpand = false, 65 aniDur = 100, //å±å¼æ¶é¿; 66 mainBgH = 350, //å±å¼æ¶èæ¯é«åº¦; 67 mainBgh = $nav.height(), 68 renderXInit = false, 69 tempHref = '', 70 defaultColor = '#4c4c4c', //ä¸»å¯¼èªæåæ²¡é䏿¶é¢è²; 71 changeColor = '#fff' //ä¸»å¯¼èªæåé䏿¶é¢è²; 72 pageHref = pageHref.substr(pageHref.lastIndexOf('/') + 1, pageHref.length) //è·åæµè§å¨å°åæ ç½åå ·ä½é¡µé¢,è¥æ²¡æåé»è®¤ä¸ºindex 73 tempHref = pageHref 74 $sub_nav_item.css({ 75 height: mainBgH - 104, 76 }) 77 78 var bindEv = function (obj, evNameWithoutOn, fn, useCapture) { 79 var _useCapture = useCapture || false 80 if (window.addEventListener) { 81 obj.addEventListener(evNameWithoutOn, fn, _useCapture) 82 } else if (window.attachEvent) { 83 obj.attachEvent('on' + evNameWithoutOn, fn) 84 } 85 } 86 var unbindEv = function (obj, evNameWithoutOn, fn) { 87 if (window.removeEventListener) { 88 obj.removeEventListener(evNameWithoutOn, fn) 89 } else if (window.detachEvent) { 90 obj.detachEvent('on' + evNameWithoutOn, fn) 91 } 92 } 93 var getDis = function (length, arr) { 94 var i = 0, 95 len = length, 96 sum = 0 97 for (; i < len; i++) { 98 sum += arr[i] 99 } 100 return sum 101 } 102 !(function () { 103 var j = 0, 104 len = main_a_len 105 for (; j < len; j++) { 106 main_a[j].index = j 107 sub_nav_item[j].index = j 108 arrW.push(main_a[j].offsetWidth) 109 } 110 whereHrefForm() 111 //if(isIndex0) main_bg.style.height="70px"; 112 })() 113 114 function whereHrefForm() { 115 var i = 0, 116 href = '', 117 len = main_a_len - 1 118 for (; i < len; i++) { 119 console.log(pageHref); 120 href = main_a[i].href 121 href = href.substr(href.lastIndexOf('/') + 1, href.length) 122 console.log(href,tempHref); 123 href = href.indexOf(tempHref) //å¨ä¸»å¯¼èªä¸æ¥æ¾å°åæ ä¸å¯¹åºç页é¢å°å 124 // return; 125 console.log(href, pageHref,1234455)//æå为false 126 if (pageHref == '' || href == -1) { 127 //妿å°åæ å ·ä½é¡µé¢ä¸ºç©º,说æä½¿ç¨ç主页çç®å½æ å°,å®é 页é¢ä¸ºindex; 128 oldestIndex = oldIndex = pageHref = 0 129 $main_a.eq(pageHref).addClass('nav-on') 130 // console.log("ç½åæ 为空"); 131 return 132 } else if (pageHref != '' && href != -1) { 133 //å¨ä¸»å¯¼èªä¸æ¾å°å¯¹åº; 134 oldestIndex = oldIndex = pageHref = i 135 $main_a.eq(pageHref).addClass('nav-on') 136 // console.log("ç½åæ ä¸ä¸ºç©ºä¸å¨ä¸»å¯¼èªä¸"); 137 return 138 } 139 } 140 getSubHref() 141 } 142 143 function getMainHref() { 144 var i = 0, 145 len = main_a_len.length - 1, 146 href = '' 147 for (; i < len; i++) { 148 href = sub_a[i].href 149 href = href.substr(href.lastIndexOf('/') + 1, href.length) 150 href = href.indexOf(tempHref) //å¨å¯å¯¼èªä¸æ¥æ¾å¯¹åºçå°åæ 页颿件å; 151 // console.log(href); 152 if (href != -1) { 153 //å¹é æå 154 // console.log("å¹é æå"); 155 oldestIndex = oldIndex = pageHref = sub_a[i].parentNode.index 156 // console.log(oldIndex); 157 $main_a.eq(oldestIndex).addClass('nav-on') 158 return 159 } else if (href == -1) { 160 //å¹é 䏿åï¼å说æå°åæ æä»¶æ¢ä¸å¨ä¸»å¯¼èªä¸ä¹ä¸å¨å¯å¯¼èªä¸ï¼å使é»è®¤index为éä¸ç¶æ; 161 // console.log("æªå¨å¯å¯¼èªä¸æ¾å°"); 162 oldestIndex = oldIndex = pageHref = 0 163 $main_a.eq(oldestIndex).addClass('nav-on') 164 } 165 } 166 } 167 168 function getSubHref() { 169 var i = 0, 170 len = sub_a.length - 1, 171 href = '' 172 for (; i < len; i++) { 173 href = sub_a[i].href 174 href = href.substr(href.lastIndexOf('/') + 1, href.length) 175 href = href.indexOf(tempHref) //å¨å¯å¯¼èªä¸æ¥æ¾å¯¹åºçå°åæ 页颿件å; 176 // console.log(href); 177 if (href != -1) { 178 //å¹é æå 179 // console.log("å¹é æå"); 180 oldestIndex = oldIndex = pageHref = sub_a[i].parentNode.index 181 // console.log(oldIndex); 182 $main_a.eq(oldestIndex).addClass('nav-on') 183 return 184 } else if (href == -1) { 185 //å¹é 䏿åï¼å说æå°åæ æä»¶æ¢ä¸å¨ä¸»å¯¼èªä¸ä¹ä¸å¨å¯å¯¼èªä¸ï¼å使é»è®¤index为éä¸ç¶æ; 186 // console.log("æªå¨å¯å¯¼èªä¸æ¾å°"); 187 oldestIndex = oldIndex = pageHref = 0 188 $main_a.eq(oldestIndex).addClass('nav-on') 189 } 190 } 191 } 192 193 var ev_nav_main_mouseenter = function (ev) { 194 //主å¯å¯¼èªé¼ æ æ¬æµ®äºä»¶ 195 var e = ev || window.event, 196 _target = e.target || e.srcElement, 197 dis = 0, 198 isMainHover =
199 _target.getAttribute('class').indexOf('nav-main-items') != -1, 200 isSubBoxHover = 201 _target.getAttribute('class').indexOf('sub-nav-item') != -1, 202 isSubHover = 203 _target.getAttribute('class').indexOf('sub-nav-items') != -1 204 // console.log(isMainHover,isSubBoxHover,isSubHover); 205 if ( 206 _target.nodeType == 1 && 207 (isMainHover || isSubBoxHover || isSubHover) 208 ) { 209 if (isMainHover) { 210 //主导èªa; 211 newIndex = _target.index 212 clearTimer() 213 subExpand() 214 if (newIndex == 0) { 215 // console.log("a") 216 unStrenchBg() 217 } 218 } else if (isSubBoxHover) { 219 if (isSubHover) { 220 //å¯å¯¼èªa 221 newIndex = _target.parentNode.index 222 if (newIndex == 0) unStrenchBg() 223 } else { 224 //å¯å¯¼èªbox 225 newIndex = _target.index 226 if (newIndex == 0) unStrenchBg() 227 } 228 } //end if..if else...; 229 dis = getDis(newIndex, arrW) + offsetx * newIndex 230 // 夿äºä»¶éå¤è°ç¨ 231 if (newIndex != oldIndex) { 232 //妿æ¯å¨å¯å¯¼èªçå䏿 aæ ç¾åæ¢ï¼åä¸ä¼åånewIndex 233 // render(dis,newIndex,oldIndex); 234 } 235 render(dis, newIndex, oldIndex) 236 } // 237 } 238 239 function subExpand() { 240 if (isSubExpand) return 241 $sub_nav.slideDown(aniDur / 1.5) 242 isSubExpand = true 243 strenchBg() 244 } 245 246 function turnFontColor(index, oldIndex) { 247 $main_a.css('color', defaultColor) 248 $main_a.eq(index).css('color', changeColor) 249 } 250 251 function renderX(dis, index, oldIndex) { 252 // console.log(dis,index,oldIndex); 253 $main_bg.stop(true, false).animate( 254 { 255 left: dis, 256 width: arrW[index], 257 }, 258 aniDur * 0.8 259 ) 260 oldIndex = pageHref 261 //turnFontColor(pageHref,oldIndex) 262 if (!renderXInit) { 263 turnFontColor(pageHref, oldIndex) 264 renderXInit = false 265 } 266 } 267 268 function render(dis, index, oldIndex) { 269 // console.log(newIndex); 270 if (!isSubExpand) subExpand() 271 if (index == 0) { 272 unStrenchBg() 273 $main_bg.stop(true, false).animate( 274 { 275 left: dis, 276 width: arrW[index], 277 }, 278 aniDur 279 ) 280 } else { 281 $main_bg.stop(true, false).animate( 282 { 283 left: dis, 284 width: arrW[index], 285 }, 286 aniDur 287 ) 288 strenchBg() 289 } 290 turnFontColor(newIndex, oldIndex) 291 oldIndex = newIndex 292 //$main_bg.stop(true,false).animate({"left":dis,"width":arrW[index]},aniDur,strenchBg) 293 } 294 295 function strenchBg() { 296 $main_bg.css({ 297 height: mainBgH, 298 }) 299 //$main_bg.stop("",false,true).animate({"height":mainBgH},aniDur/2); 300 } 301 302 function unStrenchBg() { 303 $main_bg.css({ 304 height: mainBgh, 305 }) 306 //$main_bg.stop("",true,true).animate({"height":mainBgh},aniDur/5); 307 } 308 309 function clearTimer() { 310 if (_timer) { 311 clearTimeout(_timer) 312 _timer = null 313 } 314 } 315 316 function subUp(fn) { 317 // subExpand(); 318 $sub_nav.slideUp(aniDur / 2) 319 $main_bg.stop('', true, true).animate( 320 { 321 height: mainBgh, 322 }, 323 aniDur / 2, 324 function () { 325 renderX( 326 getDis(pageHref, arrW) + offsetx * pageHref, 327 pageHref, 328 oldIndex 329 ) 330 } 331 ) 332 turnFontColor(newIndex, oldIndex) 333 isSubExpand = false 334 } 335 336 function sub_nav_up() { 337 clearTimer() 338 _timer = setTimeout(subUp, 300) 339 $main_a.eq(newIndex).addClass('nav-on') 340 // console.log(newIndex); 341 } 342 343 // $main_box.on("mouseenter",function(){ 344 // clearTimer(); 345 // subExpand(); 346 // }) 347 $main_box.on('mouseleave', function () { 348 sub_nav_up() 349 }) 350 $sub_nav.on('mouseenter', function () { 351 clearTimer() 352 subExpand() 353 }) 354 $sub_nav.on('mouseleave', function () { 355 sub_nav_up() 356 }) 357 358 renderX(getDis(pageHref, arrW) + offsetx * pageHref, pageHref, 0) 359 bindEv(main_box, 'mouseover', ev_nav_main_mouseenter) 360 bindEv(sub_nav_box, 'mouseover', ev_nav_main_mouseenter) 361 362 /* 363 //åºé¨å享é¢ç 364 $('.foot-share-ico-weixin').hover( 365 function() { 366 $('.foot-share-ico-ewm').show(); 367 }, 368 function() { 369 $('.foot-share-ico-ewm').hide(); 370 } 371 */ 372})(window, document)
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.