为什么循环只执行了一次? document.write(a);不要用它,它会将已关闭的document清空重写。换成alert(a)即可达到你想调试的效果。但推荐你用VS2005来调试程序。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题已经解决,这两天困扰我的问题也就消失了,我把代码贴出来,看有没有那种被要求内容动态,菜单也动态生成的朋友,对于我们这些菜人来说,菜单不稳定,那感受就是郁闷。本文的关键就是:动态菜单生成后,子菜单稳定地响应鼠标显示隐藏,而不是点都还没点到就没了,当然还有许多要改进的地方,但应该也不是那么难了。非常感谢Amwpfiqvy(ContextMenu)热情的回复。最郁闷的是:我去MICROSOFT下了个脚本调试器,它报告我说:我的XP系统是D版的,把脚本调试器装好后,也无法运行调试,这MICROSOFT真是牛。<!--#include file="../connect/conn.asp"--><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>MAN'S</title><link href="../css/tb.css" rel="styleMANet" type="text/css"><script language=javascript>function over(i){var k=i;document.getElementById("children"+k).style.display="";document.imgL.src="../image/index/"+i+".jpg"for(a=1;a<50;a++){if (a!=k){document.getElementById("children"+a).style.display="none";}}}</script><script language=javascript>function out(j){var m=j;document.getElementById("children"+m).style.display="none";return false;}</script></head><body class=bodycss style="width:800px;height:580px;margin:0px auto;overflow:hidden;background-color:#000000"><BASE TARGET="_parentFrame" onload="playImg()"><div style="widht:800px;height:67px;clear:both;margin:7px 0px 0px 0px"><img src="../image/indextop.gif" width="800" height="67"></div><div style="width:800px;height:460px;overflow:hidden;background-image:url(../image/indexbj.gif);background-repeat:repeat;"><div style="width:430px;height:420px;margin:20px 30px 20px 20px;clear:left;float:left;"><img src="../image/index/0.jpg" width="412" height="412" name="imgL" style="border:8px solid #999999;"></div><!--left end--> <%dim mainrs,mainsql,i i=0 set mainrs=server.createobject("adodb.recordset") mainrs.open "select mainid,mainmenu from mainmenu order by mainid",conn,1,1 while not mainrs.eof mnid=mainrs("mainid") i=i+1 %> <img src="../image/indexcenter1.jpg" class=image width="1" height="1"> <div id=<%response.write "parent"&i%> onmouseover="over(<%=i%>)" style="text-align:left;width:200px;margin:7px 0px 0px 0px;font-family:楷体_GB2312;font-weight:599;font-size:18px;padding-bottom:5px;float:left;overflow:hidden;border:none;"><a href="indexredir.asp?mainid=<%=mainrs("mainid")%>" class=linka style="text-decoration:none;color:#000000"><%=trim(replace(mainrs("mainmenu"),"MANS","Man's"))%></a> <div id=<%response.write "children"&i%> onmouseout="out(<%=i%>)" style="display:none;overflow:hidden;"> <%dim subsql,subrs subsql="select * from submenu where mainid="&mnid&" order by mainid,subid" set subrs=server.createobject("adodb.recordset") subrs.open subsql,conn,1,1 do while not subrs.eof response.write " "%> <a href="indexredir.asp?subid=<%=subrs("subid")%>&mainid=<%=subrs("mainid")%>" target="mainFrame" style="text-align:left;word-break:no-break;word-wrap:break-word;margin:0px 0px 0px 0px;font-family:楷体_GB2312;font-size:14px;height:14px;lineheight:14px;font-weight:599;clear:right;border:none;overflow:hidden;padding-top:2px;padding-bottom:3px;text-decoration:none;"><%=trim(replace(subrs("submenu"),"MANS","Man's"))%></a> <%response.write "<br>" subrs.movenext loop subrs.close set subrs=nothing%> </div><!--children end--> </div><!--parent end--> <%response.write "<br>"%> <% mainrs.movenext wend mainrs.close set mainrs=nothing conn.close%></div></div><!--leftall--><div style="widht:800px;height:42px;clear:both;margin:5px 0px 0px 0px"><img src="../image/indexbottom.gif" width="800" height="36"></div></body></html> 我正在写一个Menu,以ContextMenu作为目标载体,故取名如是。不喜欢读VB。 如何用extjs tree 动态获取xml文件 求源代码 一个很菜的JS赋值 js的text控件几次页面跳转之后回来里面的值没有了,但是鼠标移动上去值又出现了,奇怪??? 不知道为什么,数组问题。 请问大家有没有办法把这个swf取下了 一个select 选中的值如何决定另一个select的值(同一页面中)????(急) 150分求解!如何在客户端对文件进行操作? 表格的打印预览问题 用什么样技术来实现刷新是最好的? 有谁用过KENDO UI吗?商业授权是什么意思?30天过期了,还能用吗? 网页title动态问题?新手求救,在线等! 高手再看看~~~
非常感谢Amwpfiqvy(ContextMenu)热情的回复。最郁闷的是:我去MICROSOFT下了个脚本调试器,它报告我说:我的XP系统是D版的,把脚本调试器装好后,也无法运行调试,这MICROSOFT真是牛。
<!--#include file="../connect/conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>MAN'S</title>
<link href="../css/tb.css" rel="styleMANet" type="text/css">
<script language=javascript>
function over(i){
var k=i;
document.getElementById("children"+k).style.display="";
document.imgL.src="../image/index/"+i+".jpg"
for(a=1;a<50;a++){
if (a!=k){
document.getElementById("children"+a).style.display="none";
}
}
}
</script>
<script language=javascript>
function out(j){
var m=j;
document.getElementById("children"+m).style.display="none";
return false;
}
</script></head><body class=bodycss style="width:800px;height:580px;margin:0px auto;overflow:hidden;background-color:#000000"><BASE TARGET="_parentFrame" onload="playImg()">
<div style="widht:800px;height:67px;clear:both;margin:7px 0px 0px 0px"><img src="../image/indextop.gif" width="800" height="67"></div>
<div style="width:800px;height:460px;overflow:hidden;background-image:url(../image/indexbj.gif);background-repeat:repeat;"><div style="width:430px;height:420px;margin:20px 30px 20px 20px;clear:left;float:left;"><img src="../image/index/0.jpg" width="412" height="412" name="imgL" style="border:8px solid #999999;"></div><!--left end--> <%dim mainrs,mainsql,i
i=0
set mainrs=server.createobject("adodb.recordset")
mainrs.open "select mainid,mainmenu from mainmenu order by mainid",conn,1,1
while not mainrs.eof
mnid=mainrs("mainid")
i=i+1
%>
<img src="../image/indexcenter1.jpg" class=image width="1" height="1">
<div id=<%response.write "parent"&i%> onmouseover="over(<%=i%>)" style="text-align:left;width:200px;margin:7px 0px 0px 0px;font-family:楷体_GB2312;font-weight:599;font-size:18px;padding-bottom:5px;float:left;overflow:hidden;border:none;"><a href="indexredir.asp?mainid=<%=mainrs("mainid")%>" class=linka style="text-decoration:none;color:#000000"><%=trim(replace(mainrs("mainmenu"),"MANS","Man's"))%></a>
<div id=<%response.write "children"&i%> onmouseout="out(<%=i%>)" style="display:none;overflow:hidden;">
<%dim subsql,subrs
subsql="select * from submenu where mainid="&mnid&" order by mainid,subid"
set subrs=server.createobject("adodb.recordset")
subrs.open subsql,conn,1,1
do while not subrs.eof
response.write " "%>
<a href="indexredir.asp?subid=<%=subrs("subid")%>&mainid=<%=subrs("mainid")%>" target="mainFrame" style="text-align:left;word-break:no-break;word-wrap:break-word;margin:0px 0px 0px 0px;font-family:楷体_GB2312;font-size:14px;height:14px;lineheight:14px;font-weight:599;clear:right;border:none;overflow:hidden;padding-top:2px;padding-bottom:3px;text-decoration:none;"><%=trim(replace(subrs("submenu"),"MANS","Man's"))%></a>
<%response.write "<br>"
subrs.movenext
loop
subrs.close
set subrs=nothing%>
</div><!--children end-->
</div><!--parent end-->
<%response.write "<br>"%>
<%
mainrs.movenext
wend
mainrs.close
set mainrs=nothing
conn.close%></div>
</div><!--leftall-->
<div style="widht:800px;height:42px;clear:both;margin:5px 0px 0px 0px"><img src="../image/indexbottom.gif" width="800" height="36"></div>
</body></html>
不喜欢读VB。