菜单显示

yymzzl 2008-02-03 11:15:03

<SCRIPT language=JavaScript>
<!--


function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>




<SCRIPT language=JavaScript>
<!--
function MM_findObj(n,d){//v4.01
var p,i,x;
if(!d)d=document;
if((p=n.indexOf("?"))> 0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i <d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
if(!x&&d.getElementById)
x=d.getElementById(n);
return x;
}

function MM_showHideLayers(){//v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i <(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];
if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}
}
//-->
</SCRIPT>


<STYLE type=text/css>#Layertimer {
Z-INDEX: 99; POSITION: absolute
}
</STYLE>
<LINK href="Img_new/css.css" type=text/css rel=stylesheet>



<TABLE cellSpacing=0 cellPadding=0 width=780 align=center border=0>
<TBODY>
<TR>
<TD>

<TABLE cellSpacing=0 cellPadding=0 width=780 align=center background=newinc/menu_back.gif border=0>
<TBODY>
<TR>
<TD>

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>

<TD>
<P style="LINE-HEIGHT: 200%" align=center><FONT color=#ffffff>|</FONT>
<A class=top onmouseover="MM_showHideLayers('Layer0','','show')"
onmouseout="MM_showHideLayers('Layer0','','hide')" href="#">首页
</A>
</P></TD>

<TD>
<P style="LINE-HEIGHT:150%" align=center>   <FONT color=#ffffff> | </FONT>

<SPAN id=Layer2 onmouseover="MM_showHideLayers('Layer2','','show')"
style="Z-INDEX:1;VISIBILITY:hidden;POSITION:absolute"onmouseout="MM_showHideLayers('Layer2','','hide')">
<BR>

<TABLE cellSpacing=1 cellPadding=0 bgColor=#a6c4e1 border=0>
<TBODY>
<TR>
<TD align=middle bgColor=#7caedc height=27>
<A class=top href="#">二级菜单</A>
</TBODY>
</TABLE>

</span>
<A class=top onmouseover="MM_showHideLayers('Layer2','','show')"
onmouseout="MM_showHideLayers('Layer2','','hide')" href="#">一级导航菜单</A>
</P>
</TD>

</TR></TBODY></TABLE>
</td></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE>
===================================
这个是以前的菜单,鼠标放上后显示下拉,没有问题,但我现在想从数据库中导出数据显示一级菜单和二级菜单的内容
到我改了只显示一级菜单 二级菜单不显示,而且鼠标放在上面也不显示了,哪位老师给分析下
下面是改后不能显示二级菜单的代码 ,可能有点乱,谢谢了!


<!--#include file="Inc/Config.asp" -->


<SCRIPT language=JavaScript>
<!--


function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>




<SCRIPT language=JavaScript>
<!--
function MM_findObj(n,d){//v4.01
var p,i,x;
if(!d)d=document;
if((p=n.indexOf("?"))> 0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i <d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
if(!x&&d.getElementById)
x=d.getElementById(n);
return x;
}

function MM_showHideLayers(){//v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i <(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];
if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}
}
//-->
</SCRIPT>


<STYLE type=text/css>#Layertimer {
Z-INDEX: 99; POSITION: absolute
}
</STYLE>
<LINK href="Img_new/css.css" type=text/css rel=stylesheet>



<TABLE cellSpacing=0 cellPadding=0 width=780 align=center border=0>
<TBODY>
<TR>
<TD>


<TABLE cellSpacing=0 cellPadding=0 width=780 align=center background=newinc/menu_back.gif border=0>
<TBODY>
<TR>
<TD>

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>
<P style="LINE-HEIGHT: 200%" align=center><FONT color=#ffffff>|</FONT>
<A class=top onmouseover="MM_showHideLayers('Layer0','','show')" onmouseout="MM_showHideLayers('Layer0','','hide')" href="#">首页
</A>
</P></TD>


<%dim Rs,k
set Rs=server.createobject("adodb.recordset")
%>

<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from "&GuTablePrefix&"_Sort order by SortID asc",conn,1,1
if err.number <> 0 then
response.write "数据库查询出错"
else
if rs.bof and rs.eof then
response.write "没有相关信息"
else
do while not rs.eof
%>


<TD>
<P style="LINE-HEIGHT:150%" align=center>   <FONT color=#ffffff> | </FONT>
<A class=top onmouseover="MM_showHideLayers('Layer2','','show')" onmouseout="MM_showHideLayers('Layer2','','hide')" href="#"><%=rs("SortName")%></A>
<!--一级导航条菜单-->
<SPAN id=Layer2 onmouseover="MM_showHideLayers('Layer2','','show')"
style="Z-INDEX:1;VISIBILITY:hidden;POSITION:absolute"onmouseout="MM_showHideLayers('Layer2','','hide')"><BR>



<TABLE cellSpacing=1 cellPadding=0 bgColor=#a6c4e1 border=0>
<TBODY>
<TR>

<%
set SubRs=server.createobject("adodb.recordset")
ArticleTitleKB=50
SubRs.open "select top 8 "&GuTablePrefix&"_Article.ArticleID,"&GuTablePrefix&"_Article.ArticleTitle,"&GuTablePrefix&"_Article.SortID,"&GuTablePrefix&"_Article.AsSortID,"&GuTablePrefix&"_Article.ArticleShow,"&GuTablePrefix&"_Article.ArticleDate,"&GuTablePrefix&"_AsSort.AsSortName FROM "&GuTablePrefix&"_Article,"&GuTablePrefix&"_AsSort where "&GuTablePrefix&"_Article.ArticleShow='1' and "&GuTablePrefix&"_AsSort.SortID="&Rs("SortID")&" and "&GuTablePrefix&"_Article.SortID="&Rs("SortID")&" and "&GuTablePrefix&"_AsSort.AsSortID="&GuTablePrefix&"_Article.AsSortID order by "&GuTablePrefix&"_Article.ArticleDate desc,"&GuTablePrefix&"_Article.ArticleID desc",conn,1,1

if err.number <> 0 then
response.write "数据库查询出错"
else
if SubRs.bof and SubRs.eof then
response.write "没有相关信息"
else
do while not SubRs.eof
%>

<TD align=middle bgColor=#7caedc height=27>
<A class=top href="#"><%=SubRs("AsSortName")%></A>
<!--二级导航条菜单-->

<%
SubRs.movenext
loop
end if
end if
SubRs.close
%>

</TBODY>
</TABLE>
</span>
</P>
</TD>


<%
if (k mod 2)=0 then response.write ""
k=k+1
Rs.movenext
loop
end if
end if
rs.close
%>

<%
set rs=nothing
CloseDatabase
%>

</TR></TBODY></TABLE>

</td></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE>


...全文
54 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
yymzzl 2008-02-03

===================================
这个是以前的菜单,鼠标放上后显示下拉,没有问题,但我现在想从数据库中导出数据显示一级菜单和二级菜单的内容
到我改了只显示一级菜单 二级菜单不显示,而且鼠标放在上面也不显示了,哪位老师给分析下
下面是改后不能显示二级菜单的代码 ,可能有点乱,谢谢了!


<!--#include file="Inc/Config.asp" -->


<SCRIPT language=JavaScript>
<!--


function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i <(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>


<SCRIPT language=JavaScript>
<!--
function MM_findObj(n,d){//v4.01
var p,i,x;
if(!d)d=document;
if((p=n.indexOf("?"))> 0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i <d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
if(!x&&d.getElementById)
x=d.getElementById(n);
return x;
}

function MM_showHideLayers(){//v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i <(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];
if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}
}
//-->
</SCRIPT>


<STYLE type=text/css> #Layertimer {
Z-INDEX: 99; POSITION: absolute
}
</STYLE>
<LINK href="Img_new/css.css" type=text/css rel=stylesheet>


<TABLE cellSpacing=0 cellPadding=0 width=780 align=center border=0>
<TBODY>
<TR>
<TD>


<TABLE cellSpacing=0 cellPadding=0 width=780 align=center background=newinc/menu_back.gif border=0>
<TBODY>
<TR>
<TD>

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD>
<P style="LINE-HEIGHT: 200%" align=center> <FONT color=#ffffff> ¦ </FONT>
<A class=top onmouseover="MM_showHideLayers('Layer0','','show')" onmouseout="MM_showHideLayers('Layer0','','hide')" href="#"> 首页
</A>
</P> </TD>


<%dim Rs,k
set Rs=server.createobject("adodb.recordset")
%>

<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from "&GuTablePrefix&"_Sort order by SortID asc",conn,1,1
if err.number <> 0 then
response.write "数据库查询出错"
else
if rs.bof and rs.eof then
response.write "没有相关信息"
else
do while not rs.eof
%>


<TD>
<P style="LINE-HEIGHT:150%" align=center>   <FONT color=#ffffff> ¦ </FONT>
<A class=top onmouseover="MM_showHideLayers('Layer2','','show')" onmouseout="MM_showHideLayers('Layer2','','hide')" href="#"> <%=rs("SortName")%> </A>
<!--一级导航条菜单-->
<SPAN id=Layer2 onmouseover="MM_showHideLayers('Layer2','','show')"
style="Z-INDEX:1;VISIBILITY:hidden;POSITION:absolute"onmouseout="MM_showHideLayers('Layer2','','hide')"> <BR>


<TABLE cellSpacing=1 cellPadding=0 bgColor=#a6c4e1 border=0>
<TBODY>
<TR>

<%
set SubRs=server.createobject("adodb.recordset")
ArticleTitleKB=50
SubRs.open "select top 8 "&GuTablePrefix&"_Article.ArticleID,"&GuTablePrefix&"_Article.ArticleTitle,"&GuTablePrefix&"_Article.SortID,"&GuTablePrefix&"_Article.AsSortID,"&GuTablePrefix&"_Article.ArticleShow,"&GuTablePrefix&"_Article.ArticleDate,"&GuTablePrefix&"_AsSort.AsSortName FROM "&GuTablePrefix&"_Article,"&GuTablePrefix&"_AsSort where "&GuTablePrefix&"_Article.ArticleShow='1' and "&GuTablePrefix&"_AsSort.SortID="&Rs("SortID")&" and "&GuTablePrefix&"_Article.SortID="&Rs("SortID")&" and "&GuTablePrefix&"_AsSort.AsSortID="&GuTablePrefix&"_Article.AsSortID order by "&GuTablePrefix&"_Article.ArticleDate desc,"&GuTablePrefix&"_Article.ArticleID desc",conn,1,1

if err.number <> 0 then
response.write "数据库查询出错"
else
if SubRs.bof and SubRs.eof then
response.write "没有相关信息"
else
do while not SubRs.eof
%>

<TD align=middle bgColor=#7caedc height=27>
<A class=top href="#"> <%=SubRs("AsSortName")%> </A>
<!--二级导航条菜单-->

<%
SubRs.movenext
loop
end if
end if
SubRs.close
%>

</TBODY>
</TABLE>
</span>
</P>
</TD>


<%
if (k mod 2)=0 then response.write ""
k=k+1
Rs.movenext
loop
end if
end if
rs.close
%>

<%
set rs=nothing
CloseDatabase
%>

</TR> </TBODY> </TABLE>

</td> </TR> </TBODY> </TABLE>
</TD> </TR> </TBODY> </TABLE>
回复
yymzzl 2008-02-03

<SCRIPT language=JavaScript>
<!--


function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i <(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>


<SCRIPT language=JavaScript>
<!--
function MM_findObj(n,d){//v4.01
var p,i,x;
if(!d)d=document;
if((p=n.indexOf("?"))> 0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i <d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
if(!x&&d.getElementById)
x=d.getElementById(n);
return x;
}

function MM_showHideLayers(){//v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i <(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];
if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}
}
//-->
</SCRIPT>


<STYLE type=text/css> #Layertimer {
Z-INDEX: 99; POSITION: absolute
}
</STYLE>
<LINK href="Img_new/css.css" type=text/css rel=stylesheet>


<TABLE cellSpacing=0 cellPadding=0 width=780 align=center border=0>
<TBODY>
<TR>
<TD>

<TABLE cellSpacing=0 cellPadding=0 width=780 align=center background=newinc/menu_back.gif border=0>
<TBODY>
<TR>
<TD>

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>

<TD>
<P style="LINE-HEIGHT: 200%" align=center> <FONT color=#ffffff> ¦ </FONT>
<A class=top onmouseover="MM_showHideLayers('Layer0','','show')"
onmouseout="MM_showHideLayers('Layer0','','hide')" href="#"> 首页
</A>
</P> </TD>

<TD>
<P style="LINE-HEIGHT:150%" align=center>   <FONT color=#ffffff> ¦ </FONT>

<SPAN id=Layer2 onmouseover="MM_showHideLayers('Layer2','','show')"
style="Z-INDEX:1;VISIBILITY:hidden;POSITION:absolute"onmouseout="MM_showHideLayers('Layer2','','hide')">
<BR>

<TABLE cellSpacing=1 cellPadding=0 bgColor=#a6c4e1 border=0>
<TBODY>
<TR>
<TD align=middle bgColor=#7caedc height=27>
<A class=top href="#"> 二级菜单 </A>
</TBODY>
</TABLE>

</span>
<A class=top onmouseover="MM_showHideLayers('Layer2','','show')"
onmouseout="MM_showHideLayers('Layer2','','hide')" href="#"> 一级导航菜单 </A>
</P>
</TD>

</TR> </TBODY> </TABLE>
</td> </TR> </TBODY> </TABLE>
</TD> </TR> </TBODY> </TABLE>

回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-02-03 11:15
社区公告
暂无公告