<div id="menu"> <ul> <li><a href="">網(wǎng)站首頁(yè)</a></li> <li><a href="">免費(fèi)模板</a></li> </ul> </div> <script type="text/javascript" language="javascript"> var nav = document.getElementById("menu"); var links = nav.getElementsByTagName("li"); var lilen = nav.getElementsByTagName("a"); var currenturl = document.location.href; var last = 0; for (var i=0;i<links.length;i++) { var linkurl = lilen[i].getAttribute("href"); if(currenturl.indexOf(linkurl)!=-1) { last = i; } } links[last].className = "menu_on"; </script> |
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: dedecms織夢(mèng)模板下載JS代碼實(shí)現(xiàn)導(dǎo)航高亮顯示的方法