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会显示上去,但是点击右面面板后,突显就没有了,
请问如何解决阿?
要用代码的话要怎么加呢?
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会显示上去,但是点击右面面板后,突显就没有了,
请问如何解决阿?
要用代码的话要怎么加呢?
解决方案 »
- datalist嵌套 求获取子datalist的DataKey
- 如何将网页中的大量数据存入数据库中?
- xml读取表的数据!
- ascx 的问题,高人指教.散分
- 如何自由移动在panel控件上的控件?谢谢!
- treeview 的参数传递问题,newTree(TreeView treeview)调用 newTree(TreeView1);出错
- 经典问题!征集asp.net区datagrid模板列固定列宽度最佳解决方案!
- 打包的时候,怎么象petshop一样,把数据库也打到里边?
- 请问一个小问题
- Label、TextBox在禁用ViewState后不同的表现
- ★邹健★大哥帮忙看一下,小问题不会劳驾您的,很怪的问题,小弟不胜感激.也请高手赐教>>>>>>>>>>>>>>>>>>>
- C# 为什么时间插入到数据库中还有毫秒?
http://user.qzone.qq.com/31767702
background-image:url("../images/over0001.bmp");
}这是激活时,显示IMAGE,当然焦点离开后就没了。
用JS实现起来比较容易,用CSS在下就不知道了。(如果有CSS高手,也应该能解决)
<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>
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>主要是这几个地方。