Friday, 15 April 2011

javascript - jQuery hover event not firing -



javascript - jQuery hover event not firing -

code sample given below:

(function (window, document) { $('.rating_title_container').parents('.item_row_def').hover(function() { settimeout(function() { system.console('worked'); }, 1000); }); })(window, document);

i new js, jquery. can explain missing here? posted code in 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>

you need binding event handlers within doc ready (replace code above , see):

$(document).ready(function(){ $('.rating_title_container').parents('.item_row_def').hover(function() { settimeout(function() { system.console('worked'); }, 1000); }); });

javascript jquery closures

No comments:

Post a Comment