日期:2014-05-16  浏览次数:20319 次

我想通过 jquery 实现 onmousover 功能,怎么写?
<table width="1098" height="87" border='0' cellpadding='0' cellspacing='0' class="tabl" >
  <tr align='center' height="22" >
  <td width="97" height="34" align="center" bgcolor="#EAEEB3" >文章ID</td>
  <td width="38" align="center" bgcolor="#EAEEB3">选择</td>
  <td width="740" align='center' bgcolor="#EAEEB3">文章标题</td>
  <td width="107" align='center' bgcolor="#EAEEB3">置顶排序</td>
  <td width="116" align="center" bgcolor="#EAEEB3">所有操作</td>
  </tr>
   
  <form action='select_line.php' method='POST' enctype="multipart/form-data" name='myform'>
  <input name="dopost" id="dopost" type="hidden" >
   
 {dede:datalist}
   
  <tr align='center' height="22" >
  <td height="31" align="center" bgcolor="#FFFFE8" > 
  <input name="id[]" type="hidden" value="{dede:field.id/}">
  {dede:field.id/}</td>
  <td align="center" bgcolor="#FFFFE8"><input name="delid[]" type="checkbox" value="{dede:field.id/}" class="np" /></td>



<style>
tab1 .hover{
background:#ffffff;
}
</style>



以上是部分代码,

$(".tab1 td").hover(
  function () {
  // alert($(this).val());
  $(this).addClass("hover");
  },
  function () {
  $(this).removeClass("hover");
  }
); 

我这么写,不行

------解决方案--------------------
<td height="31" align="center" bgcolor="#FFFFE8" > 把TD的背景色去掉 否则看不到TR的背景色 
否则就逐个TD修改背景色