问题描述
body{margin:0;font-family:"宋体";}a{font-family:"宋体";font-size:12px;}a:link{color:#000000;text-decoration:none;}a:visited{text-decoration:none;color:#000000;}a:hover{text-decoration:underline;color:#000000;}a:active{text-decoration:none;color:#000000;}th{background-color:#FFCCFF;font-size:14px;font-weight:bold;padding:5px;text-align:center;}table{border:none;jerry:expression(cellSpacing="1");background-color:#CCCCCC;text-align:center;font-size:12px;}.nosp{border:0;jerry:expression(cellSpacing="0");text-align:center;}td{background-color:#FFFFFF;text-align:center}.menu{display:none;filter:Alpha(Opacity=20);Opacity:0.2;-moz-opacity:0.2;background-color:#99CC00;background-repeat:repeat;border:1pxsolid#0000FF;position:absolute;z-index:9999;width:120px;left:20px}
我用jquery动态显示下拉菜单,但是显示菜单的层不能与上级菜单垂直对齐,希望大伙帮帮忙,代码如下。<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title>首页</title><linkrel="stylesheet"href="style.css"type="text/css"/><scriptlanguage="javascript"src="jquery-1.2.6.pack.js"></script><scriptlanguage="javascript"><!--$(document).ready(function(){$("#menut").find("td").hover(function(){$(this).find(".menu").slideDown("slow");},function(){$(this).find(".menu").slideUp("slow");});});//--></script><styletype="text/css"><!----></style></head><body><tablewidth="980"class="nosp"><tr><tdwidth="15%"height="100">logo</td><tdvalign="bottom"><tablewidth="100%"class="nosp"><tr><td>flash</td></tr><tr><td><!--<ahref="#">菜单</a>导航--><tablewidth="100%"class="nosp"border="1"id="menut"><tr><td><div>首页</div><divclass="menu"><div><ahref="#">菜单</a>1<br/><ahref="#">菜单</a>2<br/><ahref="#">菜单</a>3</div></div></td><td><div>首页</div><divclass="menu"><div><ahref="#">菜单</a>1</div><div><ahref="#">菜单</a>2</div><div><ahref="#">菜单</a>3</div></div></td><td><div>首页</div><divclass="menu"><div><ahref="#">菜单</a>1</div><div><ahref="#">菜单</a>2</div><div><ahref="#">菜单</a>3</div></div></td><td><div>首页</div><divclass="menu"><div><ahref="#">菜单</a>1</div><div><ahref="#">菜单</a>2</div><div><ahref="#">菜单</a>3</div></div></td><td><div>首页</div><divclass="menu"><div><ahref="#">菜单</a>1</div><div><ahref="#">菜单</a>2</div><div><ahref="#">菜单</a>3</div></div></td><td><div>首页</div><divclass="menu"><div><ahref="#">菜单</a>1</div><div><ahref="#">菜单</a>2</div><div><ahref="#">菜单</a>3</div></div></td><td>首页<br/><divclass="menu"><div><ahref="#">菜单</a>1</div><div><ahref="#">菜单</a>2</div><div><ahref="#">菜单</a>3</div></div></td></tr></table></td></tr></table></td></tr></table></body></html>
JQuery用的是1.2.6
解决方案
解决方案二:
xuexi