效果可以看 
http://www.hongen.com/default.htm
急!!!!!!!!!!!!

解决方案 »

  1.   

    刚写的,有点Bug  鼠标移动到新生成的div 上出错
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <div id="Divmenu" style=" position:absolute; width:80px; height:20px; background-color:Yellow " onmouseover='createDiv()'  onmouseout='deleteDiv()'>网站首页</div>
        </div>
        </form>
        <script language="javascript" type="text/javascript">
        function createDiv()
        {
         var str="";
         str+="<div id='Childmenu' >";
         str+="<table>";
         
         str+="<tr>";
         str+="<td>";
         str+="<a href='#' >基本信息</a><br/>";
         str+="</td>";
         str+="</tr>";
         
         str+="<tr>";
         str+="<td>";
         str+="<a href='#' >联系方式</a><br/>";
         str+="</td>";
         str+="</tr>";
         
         str+="<tr>";
         str+="<td>";
         str+="<a href='#' >在线咨询</a><br/>";
         str+="</td>";
         str+="</tr>";
         
         str+="</table>";
         str+="</div>";
        var divmenu=document.getElementById("Divmenu");
       divmenu.insertAdjacentHTML("beforeEnd",str);
        }
     
        function deleteDiv()
        {
         var divmenu=document.getElementById("Divmenu");
         var childmenu=document.getElementById("Childmenu");
         divmenu.removeChild(childmenu);
        }
      
        
        
        </script>
    </body>
    </html>
      

  2.   

    <style type="text/css">
    <!--
    *{margin:0;padding:0;border:0;}
    body {
     font-family: arial, 宋体, serif;
     font-size:12px;
    }
    #nav {
     width:180px;
        line-height: 24px; 
     list-style-type: none;
     text-align:left;
        /*定义整个ul菜单的行高和背景色*/
    }/*==================一级目录===================*/
    #nav a {
     width: 160px; 
     display: block;
     padding-left:20px;
     /*Width(一定要),否则下面的Li会变形*/
    }#nav li {
     background:#CCC; /*一级目录的背景色*/
     border-bottom:#FFF 1px solid; /*下面的一条白边*/
     float:left;
     /*float:left,本不应该设置,但由于在Firefox不能正常显示
     继承Nav的width,限制宽度,li自动向下延伸*/
    }#nav li a:hover{
     background:#CC0000; /*一级目录onMouseOver显示的背景色*/
    }#nav a:link  {
     color:#666; text-decoration:none;
    }
    #nav a:visited  {
     color:#666;text-decoration:none;
    }
    #nav a:hover  {
     color:#FFF;text-decoration:none;font-weight:bold;
    }/*==================二级目录===================*/
    #nav li ul {
     list-style:none;
     text-align:left;
    }
    #nav li ul li{ 
     background: #EBEBEB; /*二级目录的背景色*/
    }#nav li ul a{
             padding-left:20px;
             width:160px;
     /* padding-left二级目录中文字向右移动,但Width必须重新设置=(总宽度-padding-left)*/
    }/*下面是二级目录的链接样式*/#nav li ul a:link  {
     color:#666; text-decoration:none;
    }
    #nav li ul a:visited  {
     color:#666;text-decoration:none;
    }
    #nav li ul a:hover {
     color:#F3F3F3;
     text-decoration:none;
     font-weight:normal;
     background:#CC0000;
     /* 二级onmouseover的字体颜色、背景色*/
    }/*==============================*/
    #nav li:hover ul {
     left: auto;
    }
    #nav li.sfhover ul {
     left: auto;
    }
    #content {
     clear: left; 
    }
    #nav ul.collapsed {
     display: none;
    }
    -->#PARENT{
     width:300px;
     padding-left:20px;
    }
    </style><div id="PARENT">
    <ul id="nav">
    <li><a href="#Menu=ChildMenu1"  onclick="DoMenu('ChildMenu1')">我的网站</a>
     <ul id="ChildMenu1" class="collapsed">
     <li><a href="http://www.chinahtml.com" target="_blank">网页教学网</a></li>
     <li><a href="#">管理</a></li>
     <li><a href="http://www.chinahtml.com" target="_blank">网页教学网</a></li>
     <li><a href="#">管理</a></li>
     <li><a href="http://www.chinahtml.com" target="_blank">网页教学网</a></li>
     <li><a href="#">管理</a></li>
     </ul>
    </li>
    <li><a href="#Menu=ChildMenu2" onclick="DoMenu('ChildMenu2')">我的帐务</a>
     <ul id="ChildMenu2" class="collapsed">
     <a href="http://www.chinahtml.com" target="_blank">支付</a></li>
     <li><a href="#">管理</a></li>
     <li><a href="#">网上支付</a></li>
     <li><a href="#">登记汇款</a></li>
     <li><a href="#">在线招领</a></li>
     <li><a href="#">历史帐务</a></li>
     </ul>
    </li>
    <li><a href="#Menu=ChildMenu3" onclick="DoMenu('ChildMenu3')">网站管理</a>
     <ul id="ChildMenu3" class="collapsed">
     <li><a href="#">登录</a></li>
     <a href="http://www.chinahtml.com" target="_blank">管理</a></li>
     <li><a href="#">管理</a></li>
     <li><a href="#">管理</a></li>
     </ul>
    </li>
    <li><a href="#Menu=ChildMenu4" onclick="DoMenu('ChildMenu4')">网站管理</a>
     <ul id="ChildMenu4" class="collapsed">
     <li><a href="#">登录</a></li>
     <a href="http://www.chinahtml.com" target="_blank">管理</a></li>
     <li><a href="#">管理</a></li>
     <li><a href="#">管理</a></li>
     <li><a href="#">管理</a></li>
     </ul>
    </li>
    </ul>
    </div><script type=text/javascript><!--
    var LastLeftID = "";function menuFix() {
     var obj = document.getElementById("nav").getElementsByTagName("li");
     
     for (var i=0; i<obj.length; i++) {
      obj[i].onmouseover=function() {
       this.className+=(this.className.length>0? " ": "") + "sfhover";
      }
      obj[i].onMouseDown=function() {
       this.className+=(this.className.length>0? " ": "") + "sfhover";
      }
      obj[i].onMouseUp=function() {
       this.className+=(this.className.length>0? " ": "") + "sfhover";
      }
      obj[i].onmouseout=function() {
       this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
      }
     }
    }function DoMenu(emid)
    {
     var obj = document.getElementById(emid); 
     obj.className = (obj.className.toLowerCase() == "expanded"?"collapsed":"expanded");
     if((LastLeftID!="")&&(emid!=LastLeftID)) //关闭上一个Menu
     {
      document.getElementById(LastLeftID).className = "collapsed";
     }
     LastLeftID = emid;
    }function GetMenuID()
    { var MenuID="";
     var _paramStr = new String(window.location.href); var _sharpPos = _paramStr.indexOf("#");
     
     if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1)
     {
      _paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
     }
     else
     {
      _paramStr = "";
     }
     
     if (_paramStr.length > 0)
     {
      var _paramArr = _paramStr.split("&");
      if (_paramArr.length>0)
      {
       var _paramKeyVal = _paramArr[0].split("=");
       if (_paramKeyVal.length>0)
       {
        MenuID = _paramKeyVal[1];
       }
      }
      /*
      if (_paramArr.length>0)
      {
       var _arr = new Array(_paramArr.length);
      }
      
      //取所有#后面的,菜单只需用到Menu
      //for (var i = 0; i < _paramArr.length; i++)
      {
       var _paramKeyVal = _paramArr[i].split('=');
       
       if (_paramKeyVal.length>0)
       {
        _arr[_paramKeyVal[0]] = _paramKeyVal[1];
       }  
      }
      */
     }
     
     if(MenuID!="")
     {
      DoMenu(MenuID)
     }
    }GetMenuID(); //*这两个function的顺序要注意一下,不然在Firefox里GetMenuID()不起效果
    menuFix();
    --></script>
      

  3.   

    楼上的,这个我也懂得  
    我后来又去找找了综合了一下<%@ Page Language="C#" AutoEventWireup="true" CodeFile="caidan.aspx.cs" Inherits="caidan" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <head>
    <script language=JavaScript>
    <!--
    function showLayer(layerName) {
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
    }
    function hideLayer(layerName) {
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
    }
    ns=0;
    layerRef="document.all"
    styleSwitch=".style"
    menutop=40;
    if (ns) menutop=43;
    //-->
    </script>
    </head>
    <body text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
    <div id=product onmouseover="javascript:showLayer('product'); hideLayer('order');"  style="Z-INDEX: 5; LEFT: 10px; VISIBILITY: hidden; WIDTH: 347px; POSITION: absolute; TOP: 21px; HEIGHT: 30px" onmouseout="javascript:hideLayer('product');">
    <TABLE height=21 cellSpacing=0 cellPadding=0 width=340 bgColor=#dfdfdf border=0>
    <TR>
    <TD width=10 > </TD>
    <TD vAlign=bottom align=middle width=80><a href="products/index.asp">产品导航</a></TD>
    <TD vAlign=bottom align=middle width=80><a href="award/index.asp">荣誉奖项</a></TD>
    <TD vAlign=bottom align=middle width=80><a href="feature/index.asp">产品特色</a></TD>
    <TD vAlign=bottom align=middle width=80><a href="certificate/index.asp">产品认证</a></TD>
    </TR>
    <TR>
    <TD width=10 bgColor=#666666 height=1></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=10 bgColor=#666666></TD></TR></TABLE>
    </div>
    <div id=order onmouseover="javascript:showLayer('order'); hideLayer('product');"
    style="Z-INDEX: 6; LEFT: 50px; VISIBILITY: hidden; WIDTH: 348px; POSITION: absolute; TOP: 21px; HEIGHT: 30px" onmouseout="javascript:hideLayer('order');">
    <TABLE height=21 cellSpacing=0 cellPadding=0 width=340 bgColor=#dfdfdf border=0>
    <TR>
    <TD width=10 bgColor=#666666> </TD>
    <TD vAlign=bottom align=middle width=80><a  href="order/index.asp">网上订购</a></TD>
    <TD vAlign=bottom align=middle width=80><a  href="auction/index.asp">网上拍卖</a></TD>
    <TD vAlign=bottom align=middle width=80><a  href="wherebuy/index.asp">各地经销</a></TD>
    <TD vAlign=bottom align=middle width=80><a  href="service/index.asp">维修条例</a></TD>
    <TD width=10 bgColor=#666666>
    <div align=center></div></TD></TR>
    <TR>
    <TD width=10 bgColor=#666666 height=1></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=10 bgColor=#666666></TD></TR></TABLE>
    </div>
    <div id=Div1 onmouseover="javascript:showLayer('Div1'); hideLayer('product');"
    style="Z-INDEX: 6; LEFT: 50px; VISIBILITY: hidden; WIDTH: 348px; POSITION: absolute; TOP: 21px; HEIGHT: 30px" onmouseout="javascript:hideLayer('Div1');">
    <TABLE height=21 cellSpacing=0 cellPadding=0 width=340 bgColor=#dfdfdf border=0>
    <TR>
    <TD width=10 bgColor=#666666> </TD>
    <TD vAlign=bottom align=middle width=80><a  href="http://www.163.com">1</a></TD>
    <TD vAlign=bottom align=middle width=80><a  href="auction/index.asp">2</a></TD>
    <TD vAlign=bottom align=middle width=80><a  href="wherebuy/index.asp">3</a></TD>
    <TD vAlign=bottom align=middle width=80><a  href="service/index.asp">4</a></TD>
    <TD width=10 bgColor=#666666>
    <div align=center></div></TD></TR>
    <TR>
    <TD width=10 bgColor=#666666 height=1></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=80 bgColor=#666666></TD>
    <TD width=10 bgColor=#666666></TD></TR></TABLE></div>
    </BODY></HTML><body>
        <form id="form1" runat="server">
        <TABLE  height=25 cellSpacing=0 cellPadding=0 width=760 border=0>
    <TBODY>
    <TR>
    <TD vAlign=center align=middle width=378 bgColor=#dfdfdf>
    <TABLE height=21 cellSpacing=0 cellPadding=0 width=360 border=0>
    <TBODY>
    <TR>
    <TD width=80>
    <div align=center><a  onmouseover="showLayer('product'); hideLayer('order');" onmouseout="hideLayer('product')"  href="bios/index.asp#">关于投洽会</a></div></TD>
    <TD width=80>
    <div align=center><a onmouseover="showLayer('order'); hideLayer('product');" onmouseout="hideLayer('order')"  href="bios/index.asp#">新闻中心</a></div></TD>
    <TD width=80>
    <div align=center><a onmouseover="showLayer('Div1');" onmouseout="hideLayer('Div1')" href="bios/index.asp#">参会指南</a></div></TD>
    </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
        </form>
    </body>
    </html>
      

  4.   

    <script language="JavaScript">
    var refer=true;
    function combo() //图片排序
     {
    if (refer)
    {
    document.all.contents.style.visibility="visible";
    refer=false;
    }
    else
    {
    document.all.contents.style.visibility="hidden";
    refer=true;
    }
    }
    </script>
    <div>
    <div class="photo_menu_1">
    <img src="../images/perbtm_sctp.gif" alt="上传图片" onclick="ShowimagePanelAdd();" style="CURSOR:hand">&nbsp;
    <img src="../images/perbtm_cjml.gif" alt="创建目录" onclick="ShowimageCreatePanelAdd();"
    style="CURSOR:hand">&nbsp; <img src="../images/perbtm_mlpx.gif" alt="图片排序" onclick="combo();" style="CURSOR:hand">
    <div id="contents" style="Z-INDEX:1; VISIBILITY:hidden; POSITION:absolute">
    <p><input type=button id="btnTimeAsc" value="时间正序"   style="WIDTH: 79px; COLOR: #ffffff; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 19px; BACKGROUND-COLOR: #003300; BORDER-BOTTOM-STYLE: none; BORDER--STYLE: none"></p>
    <p><input type=button id="btnTimeDesc" value="时间倒序"  style="WIDTH: 79px; COLOR: #ffffff; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 19px; BACKGROUND-COLOR: #003300; BORDER-BOTTOM-STYLE: none; BORDER--STYLE: none"></p>
    <p><input type=button id="btnNameAsc" value="名称正序"   style="WIDTH: 79px; COLOR: #ffffff; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 19px; BACKGROUND-COLOR: #003300; BORDER-BOTTOM-STYLE: none; BORDER--STYLE: none"></p>
    <p><input type=button id="btnNameDesc" value="名称倒序"  style="WIDTH: 79px; COLOR: #ffffff; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 19px; BACKGROUND-COLOR: #003300; BORDER-BOTTOM-STYLE: none; BORDER--STYLE: none"></p>
    </div>
    </div>