|
蓝森林 http://www.lslnet.com 2006年8月22日 18:28
!!求助一表格的CCS效果!!
求助一表格的CCS效果
在以表格内表头(第一行)显示背景图片,下面的表格用2种颜色区分隔一行换一种颜色而且当鼠标以上去就亮显
我鼓弄了好长时间没调好,请高手帮忙给一个好的范例吧
|
在你的相应td里面加上这个就可以了!
onmouseover="javascript:this.bgColor='变色'"
onmouseout="javascript:this.bgColor='原色'" bgColor=#原色 |
谢谢
不过这样只是实现了鼠标移动上后的的颜色变化,这不是我想要的啊
|
[html]
<script>
var color;
document.write ('<table width=300 border=0 cellspacing=0 cellpadding=03>');
for(i=1;i<=10;i++){
if(color=='#dedede'){color='#efefef'}
else{color='#dedede'}
document.write ('<tr><td bgcolor='+color+' onmouseover=mover(this) onmouseout=mout(this,"'+color+'")>'+i+'</td></tr>');
}
document.write ('</table>');
function mover(str){
str.bgColor='#ffffff';
}
function mout(str,color){
str.bgColor=color;
}
</script>
[/html] |
请问一下,怎么能在这个表格添加文字呢 |
谢谢!
|
http://x-lover.com/viewarticle.asp?file=Table |
|