Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Help with simple setTimeout() issue Re: [Solved] Help with simple setTimeout() issue

#65094
noahgelman
Participant

This is what I have so far


$("#menu").hover(
function () {

},
function () {

});

function doMove() {

if ($('#fragment').hasClass('selected') == true)
{
$('#mover').animate({"top": "0px"}, "fast");
};
setTimeout(doMove,5000);
};

window.onload=function() {
setTimeout(doMove,5000);
}

I’m not sure what to put in the hover function to reset to rerun doMove(). When you hover #menu, it has to stop doMove(), and when you hover back off, it has to rerun it from the beginning