Js菜鸟提问,下拉菜单的问题! 将子菜单的<div>放到主菜单对应的<td>里就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script language="javascript"><!-- function funshow() { document.all.D2.style.display=''; } function funout() { document.all.D2.style.display='none'; window.setTimeout('funshow()',3000); }//--></script><div id=D1 onmouseout="funout();">主菜单</div><p><p><p><p><p><p><p><p><p><p><p><p><p><div id=D2>子菜单</div> zltostem(尘寞) ,你这这样对付单个主菜单没问题,但如果主菜单有多个项目,鼠标从一个主菜单项目移到相临主菜单项目时,上一个子菜单不会隐藏啊!这样就会两个子菜单都出现了! 我是用VB.net从后台往前台写<div>的,如果有数组,我必须将每个主菜单所拥有的子菜单的数量传给前台,这该如何传啊? 这样呢~~~<script language="javascript"><!-- function funshow(i) { var ingc; document.form1.all['DD'+i].style.display=''; for(ingc=1;ingc<4;ingc++) { if (ingc != i) { document.form1.all['DD'+ingc].style.display='none'; } } } function funout() { var o = event.srcElement.id; switch (o) { case 'D1': document.all.DD1.style.display='none'; window.setTimeout('funshow(1)',2000); break; case 'D2': document.all.DD2.style.display='none'; window.setTimeout('funshow(2)',2000); break; case 'D3': document.all.DD3.style.display='none'; window.setTimeout('funshow(3)',2000); break; } }//--></script><form name=form1><table> <tr height="90"> <td> <div id=D1 onmouseout="funout();">菜单项目1</div> </td> <td width="200" align="right"> <div id=DD1 style=display:none>子菜单项目1</div> </td> </tr> <tr height="90"> <td> <div id=D2 onmouseout="funout();">菜单项目2</div> </td> <td width="200" align="right"> <div id=DD2 style=display:none>子菜单项目2</div> </td> </tr> <tr height="90"> <td> <div id=D3 onmouseout="funout();">菜单项目3</div> </td> <td width="200" align="right"> <div id=DD3 style=display:none>子菜单项目3</div> </td> </tr></table></form> 为大家分享jquery一些特效代码 有没有方法能让JS最后加载,以加快大页面的整体载入速度 如何像google lively那样在网页中运行exe? 同时改变多个文本框的值? js如何修改url 怎么样用js把字符串编码? JSP能清楚window.history的内容么? 求大侠们支支招 JavaScript怎样获得系统日期?谢谢! 晕倒 网页上的动态菜单(就是鼠标放上去,出现菜单的那种)在java小程序的后面,如何将他提前到最前面来? 操纵SESSION!!!急!!!!
<!--
function funshow()
{
document.all.D2.style.display='';
}
function funout()
{
document.all.D2.style.display='none';
window.setTimeout('funshow()',3000);
}
//-->
</script><div id=D1 onmouseout="funout();">主菜单</div><p><p><p><p><p><p><p><p><p><p><p><p><p>
<div id=D2>子菜单</div>
<!--
function funshow(i)
{
var ingc;
document.form1.all['DD'+i].style.display='';
for(ingc=1;ingc<4;ingc++)
{
if (ingc != i)
{
document.form1.all['DD'+ingc].style.display='none';
}
}
}
function funout()
{
var o = event.srcElement.id;
switch (o)
{
case 'D1':
document.all.DD1.style.display='none';
window.setTimeout('funshow(1)',2000);
break;
case 'D2':
document.all.DD2.style.display='none';
window.setTimeout('funshow(2)',2000);
break;
case 'D3':
document.all.DD3.style.display='none';
window.setTimeout('funshow(3)',2000);
break;
}
}
//-->
</script><form name=form1>
<table>
<tr height="90">
<td>
<div id=D1 onmouseout="funout();">菜单项目1</div>
</td>
<td width="200" align="right">
<div id=DD1 style=display:none>子菜单项目1</div>
</td>
</tr>
<tr height="90">
<td>
<div id=D2 onmouseout="funout();">菜单项目2</div>
</td>
<td width="200" align="right">
<div id=DD2 style=display:none>子菜单项目2</div>
</td>
</tr>
<tr height="90">
<td>
<div id=D3 onmouseout="funout();">菜单项目3</div>
</td>
<td width="200" align="right">
<div id=DD3 style=display:none>子菜单项目3</div>
</td>
</tr>
</table>
</form>