如何实现明暗相间的表单 <tr onmouseover="this.bgcolor='#eeeeee'" onmouseout="this.bgcolor='#ffffff'"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 怪事?你把OUT事件的那個顏色不設或者設成TABLE的背景色就可以的啦!還是我沒有理解對呢? <table border="1" width="100%"> <tr bgcolor=cccccc onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" > <td >a1</td> <td >b1</td> </tr> <tr bgcolor=dddddd onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" > <td >a2</td> <td >b2</td> </tr></table>原因见以下:css的优选级问题:<head><style>.widthTest{width:200;}</style></head>一些小知识(JK):<hr>01.width的优先级别(许多其它的样式也有类似的优先问题):<br/><input id=widthTestObj > <br/>style="width:300" <input type=checkBox onclick="if(this.checked) widthTestObj.style.width=300; else widthTestObj.style.width=null;"> <br/>class=widthTest <input type=checkBox onclick="if(this.checked) widthTestObj.className='widthTest'; else widthTestObj.className=null;"> <br/>width=100 <input type=checkBox onclick="if(this.checked) widthTestObj.width=100; else widthTestObj.removeAttribute('width');"> <br/><hr> 定义三个样式:tr0:偶数行的样式tr1:奇数行的样式trOver:鼠标移动的样式<tr class="tr0" onmouseover="doMouseOver(this);" onmouseout="doMouseOut(this);"><tr class="tr1" onmouseover="doMouseOver(this);" onmouseout="doMouseOut(this);">function doMouseOver(tr){ tr.className="trOver";}function doMouseOut(tr){ tr.className="tr"+(tr.rowIndex%2);} 随便写着玩的,50行JS实现的高级缩放效果,貌似别人用400行才实现。 谁能解释一下。 jQuery中在执行一函数后,怎样重新注册页面加载函数? 不能取得值错在哪里? 求一个div蒙板的效果 为什么我的document.height和document.width游览器显示undefined? jq如何动态获取标签id方法? jquery求一款图片集展示插件 easyui 1.3.6引用juqery.min时出错了. tab点击切换后,其自动切换出现紊乱 JS如何实现<marquee>的功能 点击一个单选按钮时,页面中的IFRAME显示某个页面
你把OUT事件的那個顏色不設或者設成TABLE的背景色就可以的啦!還是我沒有理解對呢?
<tr bgcolor=cccccc onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" >
<td >a1</td>
<td >b1</td>
</tr>
<tr bgcolor=dddddd onmouseover="this.style.backgroundColor='red';" onmouseout="this.style.backgroundColor='';" >
<td >a2</td>
<td >b2</td>
</tr>
</table>原因见以下:css的优选级问题:
<head>
<style>
.widthTest
{
width:200;
}
</style></head>一些小知识(JK):
<hr>
01.
width的优先级别(许多其它的样式也有类似的优先问题):<br/>
<input id=widthTestObj > <br/>
style="width:300" <input type=checkBox onclick="if(this.checked) widthTestObj.style.width=300; else widthTestObj.style.width=null;"> <br/>
class=widthTest <input type=checkBox onclick="if(this.checked) widthTestObj.className='widthTest'; else widthTestObj.className=null;"> <br/>
width=100 <input type=checkBox onclick="if(this.checked) widthTestObj.width=100; else widthTestObj.removeAttribute('width');"> <br/>
<hr>
tr0:偶数行的样式
tr1:奇数行的样式
trOver:鼠标移动的样式<tr class="tr0" onmouseover="doMouseOver(this);" onmouseout="doMouseOut(this);">
<tr class="tr1" onmouseover="doMouseOver(this);" onmouseout="doMouseOut(this);">
function doMouseOver(tr){
tr.className="trOver";
}
function doMouseOut(tr){
tr.className="tr"+(tr.rowIndex%2);
}