该如何 去掉连接上的下划线
<script language="javascript">
function MainMenu(id,name)
{
this.id = id;
this.name = name;
}
//定义横向菜单的构造方法
function HRMenu(id,Mid,Menuid,text)
{
this.id = id;
this.Mid = Mid; //仅对根横向菜单有用
this.Menuid = Menuid;
this.text = text;
}
var mainMenu = new Array();
//下面定义主菜单
mainMenu[0] = new MainMenu(0," 456");
mainMenu[1] = new MainMenu(1," 123");
mainMenu[2] = new MainMenu(2,"<a href=basic/55.htm> 789</a>");
mainMenu[3] = new MainMenu(3,"<a href=basic/66.htm> 234</a>");//下面定义横向菜单
var hrMenu = new Array();
//定义文件菜单
hrMenu[0] = new HRMenu(0,-1,0,"<a href=basic/444.htm> 44444</a>");
hrMenu[1] = new HRMenu(1,-1,0,"<a href=basic/3333.htm> 3333</a>");
//定义最新打开的文件子菜单
//定义编辑菜单 hrMenu[2] = new HRMenu(2,-1,1,"<a href=video/222.htm> 2222</a>");
hrMenu[3] = new HRMenu(3,-1,1,"<a href=video11111.htm> 1111</a>");//定义查看菜单//定义用来存储Popup窗口家族的数组
var pops = new Array();
function CreatePopup(degree)
{
if (degree < 0) // 层数不能小于0
return null;
if (pops[degree] != null) //如果已经存在则不需创建
return pops[degree]; if (degree == 0)
pops[0] = window.createPopup(); //创建最顶层Popup窗口
else{
if (pops[degree - 1] == null)
pops[degree - 1] = CreatePopup(degree - 1) //递归回溯从第一层开始创建
pops[degree] = pops[degree - 1].document.parentWindow.createPopup(); //从父Popup窗口创建子Popup窗口
}
pops[degree].document.body.setAttribute("degree", degree);
return pops[degree];
}
CreatePopup(2);//定义三个子菜单
var oPopup = pops[0];
</script>
<table border="2" cellpadding="2" cellspacing="2" style="font-size:9pt ">
<tr>
<script language="javascript">
for(var i = 0 ;i<mainMenu.length;i++)
{
document.write("<td width='82' onmouseover = javascript:this.style.cursor='hand' onclick=javascript:ShowHRMainMenu(" + i + ")>" + mainMenu[i].name + "</td>");
}
</script>
</tr>
</table>
<script language="javascript">
// //显示横向子菜单
function ShowHRMainMenu(id)
{ var menus = new Array();
var mainMenuId = mainMenu[id].id;
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== -1 && hrMenu[i].Menuid == mainMenuId)
{
menus[menus.length] = hrMenu[i];
}
}
var html = "<table border=0 width=80 cellpadding=0 cellspacing=0 style=font-size:9pt style=color:#000000;>"
for(var i = 0 ;i<menus.length;i++)
{
html += "<tr height=20";
var bolHasSubMenu = hasSubMenu(menus[i].id);
if(bolHasSubMenu)
{
html +=" onmouseover=javascript:this.style.background='#000000';this.style.cursor='hand'; onclick=javascript:parent.ShowSubMenu1(" + menus[i].id + "); onmouseout = javascript:this.style.background='#999999'";
}
html +=">";
html +="<td >" + menus[i].text + "</td>";
if(bolHasSubMenu)
{
html +="<td width=5> </td>";
}
else
{
html +="<td width=5> </td>";
}
html += "</tr>";
}
html += "</table>";
//document.write(html)
//alert(html);
html += "<table>"; oPopup.document.body.innerHTML = html;
oPopup.show(document.getElementById("table1").offsetLeft+mainMenuId * 90 +2 ,90, 92,menus.length * 30,document.body);
// oPopup.show((screen.width - document.body.offsetWidth)/2+mainMenuId * 89 +1 ,90, 80,menus.length * 50,document.body);
setClick(oPopup);
}
function ShowSubMenu1(menuid)
{
var menus = new Array();
var mainMenuId = hrMenu[menuid].id;
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== mainMenuId )
{
menus[menus.length] = hrMenu[i];
}
}
var html = "<table border=0 width=80 cellpadding=0 cellspacing=0 style=font-size:9pt class='PopMenuOutset'>"
for(var i = 0 ;i<menus.length;i++)
{
html += "<tr height=20";
var bolHasSubMenu = hasSubMenu(menus[i].id);
if(bolHasSubMenu)
{
html +=" onmouseover=javascript:this.style.background='#000000';this.style.cursor='hand'; onclick = javascript:parent.parent.ShowSubMenu2(" + menus[i].id + "); onmouseout = javascript:this.style.background='#ffffff'";
}
html +=">";
html +="<td >" + menus[i].text + "</td>";
if(bolHasSubMenu)
{
html +="<td width=5> </td>";
}
else
{
html +="<td width=5> </td>";
}
html += "</tr>";
}
html += "</table>";
//document.write(html)
//alert(html);
html += "<table>"; pops[1].document.body.innerHTML = html;
pops[1].show(80,20, 80,80,pops[0].document.body);
setClick(pops[1]);
}
function ShowSubMenu2(menuid)
{
var menus = new Array();
var mainMenuId = hrMenu[menuid].id;
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== mainMenuId )
{
menus[menus.length] = hrMenu[i];
}
}
var html = "<table border=0 width=80 cellpadding=0 cellspacing=0 style=font-size:9pt class='PopMenuOutset' >"
for(var i = 0 ;i<menus.length;i++)
{
html += "<tr height=20";
var bolHasSubMenu = hasSubMenu(menus[i].id);
if(bolHasSubMenu)
{
html +=" onmouseover=javascript:this.style.background='#000000' ;this.style.cursor='hand'; onmouseout = javascript:this.style.background='#ffffff'";
}
html +=">";
html +="<td >" + menus[i].text + "</td>";
if(bolHasSubMenu)
{
html +="<td width=5> </td>";
}
else
{
html +="<td width=5> </td>";
}
html += "</tr>";
}
html += "</table>";
//document.write(html)
//alert(html);
html += "<table>"; pops[2].document.body.innerHTML = html;
pops[2].show(80,40, 80,80,pops[0].document.body);
setClick(pops[2]);
} //看看这个MENU下面有没有子菜单了.
function hasSubMenu(menuId)
{
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== menuId)
{
return true;
}
}
return false;
}
function setClick(obj)
{
var objs = obj.document.getElementsByTagName("A");
for(var i=0;i<objs.length;i++)
{
if(objs[i].tagName == "A")
{
objs[i].onclick = doClick;
}
}
}
//好象在POPUP中不能直接使用链接,必须通过这个方法转换
function doClick()
{
var obj = document.getElementById("mya");
var href = this.href;
obj.href = this.href;
if(this.target != null)
{
obj.target = this.target
}
//alert(obj);
obj.click();
return false;
}
</script>
<A href="javascript:void()" id="mya" target="" ></A>
<script language="javascript">
function MainMenu(id,name)
{
this.id = id;
this.name = name;
}
//定义横向菜单的构造方法
function HRMenu(id,Mid,Menuid,text)
{
this.id = id;
this.Mid = Mid; //仅对根横向菜单有用
this.Menuid = Menuid;
this.text = text;
}
var mainMenu = new Array();
//下面定义主菜单
mainMenu[0] = new MainMenu(0," 456");
mainMenu[1] = new MainMenu(1," 123");
mainMenu[2] = new MainMenu(2,"<a href=basic/55.htm> 789</a>");
mainMenu[3] = new MainMenu(3,"<a href=basic/66.htm> 234</a>");//下面定义横向菜单
var hrMenu = new Array();
//定义文件菜单
hrMenu[0] = new HRMenu(0,-1,0,"<a href=basic/444.htm> 44444</a>");
hrMenu[1] = new HRMenu(1,-1,0,"<a href=basic/3333.htm> 3333</a>");
//定义最新打开的文件子菜单
//定义编辑菜单 hrMenu[2] = new HRMenu(2,-1,1,"<a href=video/222.htm> 2222</a>");
hrMenu[3] = new HRMenu(3,-1,1,"<a href=video11111.htm> 1111</a>");//定义查看菜单//定义用来存储Popup窗口家族的数组
var pops = new Array();
function CreatePopup(degree)
{
if (degree < 0) // 层数不能小于0
return null;
if (pops[degree] != null) //如果已经存在则不需创建
return pops[degree]; if (degree == 0)
pops[0] = window.createPopup(); //创建最顶层Popup窗口
else{
if (pops[degree - 1] == null)
pops[degree - 1] = CreatePopup(degree - 1) //递归回溯从第一层开始创建
pops[degree] = pops[degree - 1].document.parentWindow.createPopup(); //从父Popup窗口创建子Popup窗口
}
pops[degree].document.body.setAttribute("degree", degree);
return pops[degree];
}
CreatePopup(2);//定义三个子菜单
var oPopup = pops[0];
</script>
<table border="2" cellpadding="2" cellspacing="2" style="font-size:9pt ">
<tr>
<script language="javascript">
for(var i = 0 ;i<mainMenu.length;i++)
{
document.write("<td width='82' onmouseover = javascript:this.style.cursor='hand' onclick=javascript:ShowHRMainMenu(" + i + ")>" + mainMenu[i].name + "</td>");
}
</script>
</tr>
</table>
<script language="javascript">
// //显示横向子菜单
function ShowHRMainMenu(id)
{ var menus = new Array();
var mainMenuId = mainMenu[id].id;
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== -1 && hrMenu[i].Menuid == mainMenuId)
{
menus[menus.length] = hrMenu[i];
}
}
var html = "<table border=0 width=80 cellpadding=0 cellspacing=0 style=font-size:9pt style=color:#000000;>"
for(var i = 0 ;i<menus.length;i++)
{
html += "<tr height=20";
var bolHasSubMenu = hasSubMenu(menus[i].id);
if(bolHasSubMenu)
{
html +=" onmouseover=javascript:this.style.background='#000000';this.style.cursor='hand'; onclick=javascript:parent.ShowSubMenu1(" + menus[i].id + "); onmouseout = javascript:this.style.background='#999999'";
}
html +=">";
html +="<td >" + menus[i].text + "</td>";
if(bolHasSubMenu)
{
html +="<td width=5> </td>";
}
else
{
html +="<td width=5> </td>";
}
html += "</tr>";
}
html += "</table>";
//document.write(html)
//alert(html);
html += "<table>"; oPopup.document.body.innerHTML = html;
oPopup.show(document.getElementById("table1").offsetLeft+mainMenuId * 90 +2 ,90, 92,menus.length * 30,document.body);
// oPopup.show((screen.width - document.body.offsetWidth)/2+mainMenuId * 89 +1 ,90, 80,menus.length * 50,document.body);
setClick(oPopup);
}
function ShowSubMenu1(menuid)
{
var menus = new Array();
var mainMenuId = hrMenu[menuid].id;
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== mainMenuId )
{
menus[menus.length] = hrMenu[i];
}
}
var html = "<table border=0 width=80 cellpadding=0 cellspacing=0 style=font-size:9pt class='PopMenuOutset'>"
for(var i = 0 ;i<menus.length;i++)
{
html += "<tr height=20";
var bolHasSubMenu = hasSubMenu(menus[i].id);
if(bolHasSubMenu)
{
html +=" onmouseover=javascript:this.style.background='#000000';this.style.cursor='hand'; onclick = javascript:parent.parent.ShowSubMenu2(" + menus[i].id + "); onmouseout = javascript:this.style.background='#ffffff'";
}
html +=">";
html +="<td >" + menus[i].text + "</td>";
if(bolHasSubMenu)
{
html +="<td width=5> </td>";
}
else
{
html +="<td width=5> </td>";
}
html += "</tr>";
}
html += "</table>";
//document.write(html)
//alert(html);
html += "<table>"; pops[1].document.body.innerHTML = html;
pops[1].show(80,20, 80,80,pops[0].document.body);
setClick(pops[1]);
}
function ShowSubMenu2(menuid)
{
var menus = new Array();
var mainMenuId = hrMenu[menuid].id;
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== mainMenuId )
{
menus[menus.length] = hrMenu[i];
}
}
var html = "<table border=0 width=80 cellpadding=0 cellspacing=0 style=font-size:9pt class='PopMenuOutset' >"
for(var i = 0 ;i<menus.length;i++)
{
html += "<tr height=20";
var bolHasSubMenu = hasSubMenu(menus[i].id);
if(bolHasSubMenu)
{
html +=" onmouseover=javascript:this.style.background='#000000' ;this.style.cursor='hand'; onmouseout = javascript:this.style.background='#ffffff'";
}
html +=">";
html +="<td >" + menus[i].text + "</td>";
if(bolHasSubMenu)
{
html +="<td width=5> </td>";
}
else
{
html +="<td width=5> </td>";
}
html += "</tr>";
}
html += "</table>";
//document.write(html)
//alert(html);
html += "<table>"; pops[2].document.body.innerHTML = html;
pops[2].show(80,40, 80,80,pops[0].document.body);
setClick(pops[2]);
} //看看这个MENU下面有没有子菜单了.
function hasSubMenu(menuId)
{
for(var i = 0 ;i<hrMenu.length;i++)
{
//如果是第一级根菜单
if(hrMenu[i].Mid== menuId)
{
return true;
}
}
return false;
}
function setClick(obj)
{
var objs = obj.document.getElementsByTagName("A");
for(var i=0;i<objs.length;i++)
{
if(objs[i].tagName == "A")
{
objs[i].onclick = doClick;
}
}
}
//好象在POPUP中不能直接使用链接,必须通过这个方法转换
function doClick()
{
var obj = document.getElementById("mya");
var href = this.href;
obj.href = this.href;
if(this.target != null)
{
obj.target = this.target
}
//alert(obj);
obj.click();
return false;
}
</script>
<A href="javascript:void()" id="mya" target="" ></A>
你在调用的页面加入指定的样式就可以了啊。
a: {color: #83006f;text-decoration:none;}
这个会将所有的连接下划线去掉.