Jump to content

End onmousemove with timing event


xcandiottix

Recommended Posts

How could I code a function that waits for the visitor to move their mouse, executes a code when they move the mouse, then the function times out after say a second. So basically If a user visits my site, there is a hidden table, when the user moves their mouse it "wakes up" the mousemove code which displays a table, then the code goes to sleep so the user can interact with the table. If the code doesnt go back to sleep the table just keeps refreshing it self every mouse move.

 

Here's the code I need to only happen once:

window.onmousemove=function(f){
title1=xmlDoc.getElementsByTagName("Name")[0].getElementsByTagName("Cell")[0].getElementsByTagName("title")[0].childNodes[0].nodeValue;
document.getElementById("title1").innerHTML=title1;
};

 

The reason I am doing this is because if I use window.onload it will not show the table. If I use onmousemove the table appears. I think there is a conflict between where my include is nested and where the XML is loaded but the page is +800 lines of code and this seems like an easier work around to try this. Any better ideas are also welcome!

 

Thanks

Link to comment
Share on other sites

Here's how...

 

window.onmousemove=function(){

window.onmousemove=null;

title1=xmlDoc.getElementsByTagName("Name")[0].getElementsByTagName("Cell")[0].getElementsByTagName("title")[0].childNodes[0].nodeValue;

document.getElementById("title1").innerHTML=title1;

};

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.