http://community.csdn.net/Expert/topic/5313/5313437.xml?temp=.4201166这里还有100分~~~A:link{
color:#215DC6;
text-decoration:none;
}
A:active:{
color:#428EFF;
text-decoration:none;
background-image:url("../images/over0001.bmp");
}
A:visited{
color:#215DC6;
text-decoration:none;
}
A:hover{
color:#428EFF;
}
以上是左侧导航菜单在CSS中的设置,(over0001.bmp为一突显颜色图片)点击后,over0001会显示上去,但是点击右面面板后,突显就没有了,
请问如何解决阿?
要用代码的话要怎么加呢?

解决方案 »

  1.   

    帮LZ顶
      
    http://user.qzone.qq.com/31767702
      

  2.   

    A:active:{
    background-image:url("../images/over0001.bmp");
    }这是激活时,显示IMAGE,当然焦点离开后就没了。
    用JS实现起来比较容易,用CSS在下就不知道了。(如果有CSS高手,也应该能解决)
      

  3.   

    <html>
    <head>
    <title>菜单</title>
    <meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
    <script language='JavaScript'>
    var headHeight = 20;var bodyHeight = 280;var objcount = 8;var step = 10;var moving = false;function showme(obj1, obj2)
    {
    if (moving)
    return;
    moving = true;
    for(i=0;i<document.all.tags('td').length;i++)
    if (document.all.tags('td')[i].className.indexOf('headtd') == 0)
    document.all.tags('td')[i].className = 'headtd1';
    obj2.className = 'headtd2';
    moveme(obj1);
    }
    function moveme(obj)
    {
    idnumber = parseInt(obj.id.substr(4));
    objtop = headHeight * (idnumber - 1);
    objbuttom = bodyHeight + headHeight * (idnumber - 2);
    currenttop = parseInt(obj.style.top);
    if (currenttop >= objbuttom)
    {
    countid = 1;
    for(i=0;i<document.all.tags('div').length;i++)
    if (document.all.tags('div')[i].id == 'item'+countid+'body')
    {
    obj = document.all.tags('div')[i];
    objtop = headHeight * (countid - 1);
    if (countid == idnumber)
    {
    moveup(obj,objtop,false);
    break;
    }
    else
    moveup(obj,objtop,true);
    countid++;
    }
    }
    else if ((currenttop <= objtop) && (idnumber < objcount))
    {
    idnumber++;
    countid = objcount;
    for(i=document.all.tags('div').length-1;i>=0;i--)
    if (document.all.tags('div')[i].id == 'item'+countid+'body')
    {
    obj = document.all.tags('div')[i];
    objbuttom = bodyHeight + headHeight * (countid - 2);
    if (countid == idnumber)
    {
    movedown(obj,objbuttom,false);
    break;
    }
    else
    movedown(obj,objbuttom,true);
    countid--;
    }
    }
    }
    function moveup(obj,objtop,ismove)
    {
    currenttop = parseInt(obj.style.top);
    if (currenttop > objtop)
    {
    obj.style.top = currenttop - step;
    setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1)
    return;
    }
    moving = ismove;
    }
    function movedown(obj,objbuttom,ismove)
    {
    currenttop = parseInt(obj.style.top);
    if (currenttop < objbuttom)
    {
    obj.style.top = currenttop + step;
    setTimeout('movedown('+obj.id+','+objbuttom+','+ismove+')',1)
    return;
    }
    moving = ismove;
    }
    </script>
    <style type='text/css'>
    .headtd1 {  background: #799AE1; border: 2px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF; cursor: hand; font-size: 9pt}
    .headtd2 {  background: #20C1FF; border: 2px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand; font-size: 9pt}
    .bodytd  {  background: #D6DFF7; border: 1px; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt}
    </style>
    </head>
    <body bgcolor='#7a8ce0' text='#000000'>
    <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
            <tr><td height="420px">
    <div id='mainboard' style='position:absolute; left:2px; top:2px; width:120px; height:420px; z-index:1; overflow: hidden; background: #99CCFF;'>
        <div id='item1body' style='position:absolute; left:0; top:0; width:120px; height:280px; z-index:2; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                <tr><td id='item1head' height='18' class='headtd2' onclick='showme(item1body,this)' align='center'>基础信息管理</td></tr>
                <tr><td class='bodytd' height="20" align='center'><a href="BaseModule/ViewAreaPart2.aspx" target="right">区域管理</a></td></tr>
                <tr><td class='bodytd' align='center'></td></tr>
            </table>
        </div>
        <div id='item2body' style='position:absolute; left:0; top:280; width:120px; height:280px; z-index:3; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                <tr><td id='item2head' height='18' class='headtd1' onclick='showme(item2body,this)' align='center'>客户管理</td></tr>
                <tr><td class='bodytd' align='center'></td></tr>
            </table>
       </div>
       <div id='item3body' style='position:absolute; left:0; top:300; width:120px; height:280px; z-index:4; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                <tr><td id='item3head' height='18' class='headtd1' onclick='showme(item3body,this)' align='center'>项目管理</td></tr>
                <tr><td class='bodytd' align='center'></td></tr>
            </table>
       </div>
       <div id='item4body' style='position:absolute; left:0; top:320; width:120px; height:280px; z-index:5; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                <tr><td id='item4head' height='18' class='headtd1' onclick='showme(item4body,this)' align='center'>现场支撑</td></tr>
                    <tr><td class='bodytd' height="20" align='center'>通告管理</td></tr>
                    <tr><td class='bodytd' height="20" align='center'>知识类别</td></tr>
                    <tr><td class='bodytd' align='center'></td></tr>
            </table>
       </div>
       <div id='item5body' style='position:absolute; left:0; top:340; width:120px; height:280px; z-index:6; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                    <tr><td id='item5head' height='18' class='headtd1' onclick='showme(item5body,this)' align='center'>数据处理</td></tr>               
                    <tr><td class='bodytd' align='center'></td></tr>
            </table>
       </div>
       <div id='item6body' style='position:absolute; left:0; top:360; width:120px; height:280px; z-index:7; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                    <tr><td id='item6head' height='18' class='headtd1' onclick='showme(item6body,this)' align='center'>话务类报表</td></tr>
                    <tr><td class='bodytd' height="20" align='center'><a href="Reports/ProjectReports.aspx?WhichReport=1" target="right">单项项目每日话务明</a></td></tr>
                    <tr><td class='bodytd' height="20" align='center'><a href="Reports/PersonReports.aspx?WhichReport=1" target="right">单项项目个人统计表</a></td></tr>
                    <tr><td class='bodytd' align='center'></td></tr>
            </table>
       </div>
       <div id='item7body' style='position:absolute; left:0; top:380; width:120px; height:280px; z-index:8; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                    <tr><td id='item7head' height='18' class='headtd1' onclick='showme(item7body,this)' align='center'>业务报表</td></tr>
                    <tr><td class='bodytd' height="20" align='center'>月结客户开发统计表</td></tr>
                    <tr><td class='bodytd' height="20" align='center'>项目调查结果行政区</td></tr>
                    <tr><td class='bodytd' align='center'></td></tr>
            </table>
       </div>
       <div id='item8body' style='position:absolute; left:0; top:400; width:120px; height:280px; z-index:9; overflow: hidden'>
            <table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'>
                    <tr><td id='item8head' height='18' class='headtd1' onclick='showme(item8body,this)' align='center'>投诉建议汇总报表 </td></tr>
                    <tr><td class='bodytd' height="20" align='center'>投诉、建议汇总表</td></tr>
                    <tr><td class='bodytd' align='center'></td></tr>
             </table>
       </div>
    </div>
    </td>
    </tr>
    <tr>
    <td>
    <div style="overflow: auto; width: 120px; height: 180px;">
    <table>
    <tr><td style="word-break: break-all; word-wrap:break-word;">
    </td></tr>
    </table>
    </div>
    </td>
    </tr>
    </table>
    </body>
    </html>
      

  4.   

    搂主你要的for(i=0;i<document.all.tags('td').length;i++)
    if (document.all.tags('td')[i].className.indexOf('headtd') == 0)
    document.all.tags('td')[i].className = 'headtd1';
    obj2.className = 'headtd2';
    <style type='text/css'>
    .headtd1 {  background: #799AE1; border: 2px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF; cursor: hand; font-size: 9pt}
    .headtd2 {  background: #20C1FF; border: 2px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand; font-size: 9pt}
    .bodytd  {  background: #D6DFF7; border: 1px; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt}
    </style>主要是这几个地方。
      

  5.   

    在ASP.NET 2.0自带Menu上用纯CSS做不到的,一定要加JavaScript来确定当前点击的菜单项,并且找出它的所有祖先菜单项并改变className。然后还要修改当Menu关闭时的代码,也就是将这些className改回去。如果你自己的JavaScript功底过关,你可以自行研究Menu自带的那个Menu.js,然后看看如何改进。我建议不要用原本那个Menu的输出样式,因为它是<table />排版,而用ASP.NET CSS Friendly ControlAdapter(你用Google搜索一下就能找到这东西),经它修正后的Menu输出时<ul />,这样其JavaScript也就变得简单了。