如何在TR中将TD上的TD的鼠标悬停绑定? [英] How can I unbind a mouseover in jQuery for a TD within a TR?
本文介绍了如何在TR中将TD上的TD的鼠标悬停绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的HTML:
<table id="myTable">
<tr class="myTr">
<td>
CELL 1
</td>
<td>
Cell 2
</td>
<td class="notThis">
Cell 3
</td>
</tr>
<tr class="myTr">
<td>
2- CELL 1
</td>
<td>
2- Cell 2
</td>
<td>
2- Cell 3
</td>
</tr>
</table>
<div id="myDiv">CONSOLE</div>
还有我的Javascript:
And my Javascript:
$(document).ready( function() {
$(".myTr").mouseover( function() {
$("#myDiv").html( "OVER" );
} );
});
我想要它,以便当您将鼠标悬停在"notThis"单元格上时,不会触发鼠标悬停.我设置了一个小提琴进行测试: http://jsfiddle.net/S7bfH/3/
I want it so that when you mouseover the "notThis" cell, the mouseover doesn't trigger. I have a fiddle set up for testing: http://jsfiddle.net/S7bfH/3/
谢谢
推荐答案
此处:
$(".myTr td:not('.notThis')").hover( function() {
$("#myDiv").html( "ACTIVE" );
}, function() {
$("#myDiv").html( "INACTIVE" );
});
这篇关于如何在TR中将TD上的TD的鼠标悬停绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文