js下拉式菜单点击展开,如何修改成默认展开二级菜单?
//产品分类导航varmenuids=["suckertree1"]//Enterid(s)ofSuckerTreeULmenus,separatedbycommasfu...
//产品分类导航
var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
function comment_check() {
if ( document.form1.name.value == '' ) {
window.alert('Please input your name^_^');
document.form1.name.focus();
return false;}
if ( document.form1.email.value.length> 0 &&!document.form1.email.value.indexOf('@')==-1|document.form1.email.value.indexOf('.')==-1 ) {
window.alert('Please input your right email address,for example:webmaster@hitux.com');
document.form1.email.focus();
return false;}
if(document.form1.qq.value.search(/^([0-9]*)([.]?)([0-9]*)$/) == -1)
{
window.alert("Please innput the number^_^");
document.form1.qq.focus();
return false;} 展开
var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
function comment_check() {
if ( document.form1.name.value == '' ) {
window.alert('Please input your name^_^');
document.form1.name.focus();
return false;}
if ( document.form1.email.value.length> 0 &&!document.form1.email.value.indexOf('@')==-1|document.form1.email.value.indexOf('.')==-1 ) {
window.alert('Please input your right email address,for example:webmaster@hitux.com');
document.form1.email.focus();
return false;}
if(document.form1.qq.value.search(/^([0-9]*)([.]?)([0-9]*)$/) == -1)
{
window.alert("Please innput the number^_^");
document.form1.qq.focus();
return false;} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询