Click to See Complete Forum and Search --> : onNothing?


router
08-13-2003, 06:00 AM
Hello everybody!
I wanna to know display a message on my page 3 seconds later when a user is doing nothing (when the mouse and the cursor aren't moving).
Does it exists something like 'onclick' to do it?Maybe 'onNothig' or similiar?
Any idea?
Thanks!!
Router :)

PD: I wanna do something like that but instead 'onclik' , 'onNothing'(if it exists).

document.onclick = function() { _click();
}

function _click() {
window.setTimeout(alert("Anybody here?")' ,3);
}

pyro
08-13-2003, 08:33 AM
Try something like this:

<script type="text/javascript">
function showMessage() {
alert("Anybody here?");
}
document.onmousemove = function() {
clearInterval(mytimeout);
mytimeout = window.setInterval("showMessage()", 3000);
}
window.onload = function() {
mytimeout = window.setInterval("showMessage()", 3000);
}
</script>

Khalid Ali
08-13-2003, 08:58 AM
Hey pyro your ,I think in your sollution your message will be displayed regarles if the mouse is static for 3 secs or not..:-)

pyro
08-13-2003, 09:05 AM
It works fine in IE6, Mozilla 1.2, Opera 7 and Netscape 7. It does not work in NN4.7 (as that does not support document.onmousemove)

router
08-13-2003, 09:33 AM
It works fine!
Thank you very much!
Router ;)

Khalid Ali
08-13-2003, 09:39 AM
Originally posted by pyro
It works

no worries....I was just pointing it out ..did not test it myself..so I could be seriously wrong..:D

pyro
08-13-2003, 09:42 AM
lol... No problem, buddy... :)