日期:2014-05-17 浏览次数:21027 次
function redirect(){ var preBtn = document.getElementById("present"); var linksList = document.getElementById("links"); linksList.style.display = "none"; preBtn.onclick = function(){ if(linksList.style.display == "none"){ linksList.style.display = "block"; }else{ linksList.style.display = "none"; } } alllinks = linksList.getElementsByTagName("li"); for(i=0; i<alllinks.length; i++){ alllinks[i].getElementsByTagName("a")[0].onclick = function(){ preBtn.innerHTML = this.innerHTML; linksList.style.display = "none"; } } document.getElementsByTagName("body")[0].onclick = function(evt){ if(!evt) var evt = window.event; var evtObj = evt.target?evt.target:evt.srcElement; if(evtObj.id != "present"){ linksList.style.display = "none"; } } } function startList() { var ul = document.getElementById("ul_mainNav"); var li = ul.getElementsByTagName("li"); var a = ul.getElementsByTagName("a"); for(i=0; i<a.length; i++){ a[i].onfocus = function(){this.blur()}; } for(i=0; i<li.length; i++){ li[i].ids = i; /*li[i].getElementsByTagName("a")[0].onfocus = function(){this.blur()}; li[i].getElementsByTagName("a")[0].onclick = function(){return false;};*/ li[i].onmouseover = function(){ var m=this.ids; li[m].className = "li_over"; } li[i].onmouseout = function(){ var m=this.ids; li[m].className = ""; } } function controlW(contWP){ var ul = document.getElementById(contWP); var li = ul.getElementsByTagName("li"); var sum = 0; var w = 0; for(i=0; i<li.length; i++){ w =li[i].clientWidth; sum = sum+w; } ul.style.width =sum+"px"; sum = 0; /*alert(li[2].clientWidth);*/ } controlW("ul_subnav_1"); controlW("ul_subnav_2"); controlW("ul_subnav_3"); controlW("ul_subnav_4"); controlW("ul_subnav_5"); controlW("ul_subnav_6"); controlW("ul_subnav_7"); controlW("ul_subnav_8"); } function sideNav(){ if(document.getElementById("subNav")){ var ulWra = document.getElementById("subNav"); var ul = ulWra.getElementsByTagName("ul")[0]; var lis = ul.getElementsByTagName("li"); for(i=0; i<lis.length; i++){ if(lis[i].getElementsByTagName("ul")[0]){ lis[i].getElementsByTagName("ul")[0].className = "off"; lis[i].getElementsByTagName("a")[0].onfocus = function(){this.blur()}; lis[i].getElementsByTagName("a")[0].onclick = function(){return false}; lis[i].onclick = function(){ if(this.getElementsByTagName("ul")[0]){ if(this.getElementsByTagName("ul")[0].style.display == "block"){ this.getElementsByTagName("ul")[0].style.display = "none"; }else{ this.getElementsByTagName("ul")[0].style.display = "block"; } } } } } } } if(window.attachEvent){ window.attachEvent("onload",redirect); window.attachEvent("onload",startList); //window.attachEvent("onload",gallery); //window.attachEvent("onload",stones); //window.attachEvent("onload",i