我有此頁。當我更改條目數時,新顯示的條目'mouseover失敗。jQuery DataTables鼠標懸停問題
<!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=UTF-8" />
<script type="text/javascript" src="http://www.datatables.net/release-datatables/media/js/jquery.js"></script>
<script type="text/javascript" src="http://www.datatables.net/release-datatables/media/js/jquery.dataTables.js"></script>
<link href="http://www.datatables.net/release-datatables/media/css/demo_table.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
.edit {display: none}
</style>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable();
});
</script>
<script>
jQuery(document).ready(function() {
jQuery('#example tr').mouseover(function() {
jQuery(this).find('span:first').show();
}).mouseout(function() {
jQuery(this).find('span:first').hide();
});
});
</script>
</head>
<body>
<table id="example" class="display">
<thead>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th width="24em;"> </th>
</tr>
</thead>
<tbody>
<tr class="gradeA" >
<td>a1</td>
<td>b1</td>
<td>c1</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a2</td>
<td>b2</td>
<td>c2</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a3</td>
<td>b3</td>
<td>c3</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a4</td>
<td>b4</td>
<td>c4</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a5</td>
<td>b5</td>
<td>c5</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a6</td>
<td>b6</td>
<td>c6</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a7</td>
<td>b7</td>
<td>c7</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a8</td>
<td>b8</td>
<td>c8</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a9</td>
<td>b9</td>
<td>c9</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a10</td>
<td>b10</td>
<td>c10</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a11</td>
<td>b11</td>
<td>c11</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a12</td>
<td>b12</td>
<td>c12</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a13</td>
<td>b13</td>
<td>c13</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
<tr class="gradeA" >
<td>a14</td>
<td>b14</td>
<td>c14</td>
<td> <span class="edit"> <a href="#">EDIT</a> </span> </td>
</tr>
</tbody>
</table>
</body>
我有1.7.1。上面的代碼片段沒有幫助。閱讀():) – publicRavi 2012-02-29 17:59:51