我想使用 Bind 和 Unbind Please。我有一个多行的表。我有每一行的单选按钮。当我执行 html 时,我可以将鼠标悬停在每一行上,每一行都会变成浅蓝色。如果我选择一个单选按钮,我不能再将鼠标悬停在我没有选择的其他行上。请帮帮我
<table id ="myTable">
<tr>
<th>Selected</th>
<th>First Name</th>
<th>Middle Name</th>
<th style="width: 10%;">Last Name</th>
<th>Active Email</th>
<tr>
<td><input class ="rad" type="radio" name="developerRadio" value="Value 1" /></td>
<td>Hello</td>
<td>everyone</td>
<td>good</td>
<td>email</td>
<td>hello</td>
</tr>
<tr>
<td><input class ="rad" type="radio" name="developerRadio" value="Value 1" /></td>
<td>Hello</td>
<td>everyone</td>
<td>good</td>
<td>email</td>
<td>hello</td>
</tr>
<tr>
<td><input class ="rad" type="radio" name="developerRadio" value="Value 1" /></td>
<td>Hello</td>
<td>everyone</td>
<td>good</td>
<td>email</td>
<td>hello</td>
</tr>
<script>
$(document).ready(function () {
$("tr").mouseover(function () {
$(this).css("background-color", "#0066FF");
});
$("tr").mouseout(function () {
$(this).css("background-color", "");
});
$('input:radio').click(function () {
$("tr").unbind("mouseover mouseout");
$(this)
.closest('tr')
.siblings()
.css('background-color', 'white')
.end()
.css('background-color', 'darkblue');
$("input:radio")
.unbind("click")
.click(function () {
$('tr').bind("mouseover");
$(this).closest('tr').css('background-color', "#0066FF");
});
});
});
</script>