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
https://forums.phpfreaks.com/topic/206552-end-onmousemove-with-timing-event/
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;

};

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.