代码示例:jQuery的悬停事件不触发如下
(function (window, document) {
$('.rating_title_container').parents('.item_row_def').hover(function() {
setTimeout(function() {
system.console('Worked');
}, 1000);
});
})(window, document);
我是相当新的JS,jQuery的。任何人都可以解释我在这里失踪了吗?在 发布代码http://jsfiddle.net/p7gBy/5/
HTML
<table>
<thead>
<tr>
<th class="item_row_def" onclick="sort(3);">
<table class="col-header">
<tbody>
<tr>
<td>
<h2 class="header_title rating_title_container">Rating</h2>
</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
</table>
此代码运行时,马上你叫吧,如果是在头文件的剩余部分还没有准备好,所以也找不到任何元素 – dmi3y 2013-02-19 04:31:27
你可以把它放在一个小提琴? – arjuncc 2013-02-19 04:31:52
你可以发布你的HTML吗? – 2013-02-19 04:32:01