javascript - Trouble with jquery .hover function -
having issue jquery .hover function. able work if wrap in generic $(function(){
have seen done without needing generic function, if can see doing wrong appreciate it.
this not work:
$('#slider > img').hover(function () { stoploop(); }, function () { startslider(); });
this work:
$(function () { $('#slider > img').hover(function () { stoploop(); }, function () { startslider(); }); });
simple answer trying bind events tags while not exists in dom. make in $(document).ready()
or $(function()
$(document).ready(function() { $('#slider > img').hover(function () { stoploop(); }, function () { startslider(); }); });
Comments
Post a Comment