jquery hover ajax

hanliuxinming 2014-09-28

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>jQuery hover特效</title>
<script src="/ajaxjs/jquery1.3.2.js" type="text/javascript"></script> 
<script type="text/javascript">
$(document).ready(function() {
$("#orderedlist tbody tr").hover(function() {
		$(this).addClass("blue");
	}, function() {
		$(this).removeClass("blue");
	});
});
</script>
<style>
.blue {
        background:#bcd4ec;  
}
</style>
</head>
<body>
<table id="orderedlist" width="50%" border="0" cellspacing="0" cellpadding="0"> 
<!--用class="stripe"来标识需要使用该效果的表格-->
<thead>
  <tr>
    <th>姓名</th>
    <th>年龄</th>
    <th>QQ</th>
    <th>Email</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>abc</td>
    <td>23</td>
    <td>31540205</td>
    <td>[email protected]</td>
  </tr>
  <tr>
    <td>def</td>
    <td>23</td>
    <td>31540205</td>
    <td>[email protected]</td>
  </tr>
  <tr>
    <td>ghi</td>
    <td>23</td>
    <td>31540205</td>
    <td>[email protected]</td>
  </tr>
</tbody>
</table>
</body>
</html>

相关推荐