View Single Post
Old Apr 29th, 2005, 11:57 AM   #2
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,645
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
ok well i got it working but im still looking for another way to do it cause this i dont know if it is how he would want it but it does work so if anyone else knows of a better way let me know. here is my code

<?xml version = "1.0"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
  <!-- onmousemove.html		  -->
  <!-- Demonstrating the onmousemove event  -->
  
  <html xmlns = "http://www.w3.org/1999/xhtml">
     <head>
  	  <title>DHTML Event Model - onmousemove event</title>
  	  <script type = "text/javascript">
  		<!--
  		var sit = 0;
  
  		 function follow()
  		 {
  			 if(sit == 0)
  			 {
  				 myImage.style.top = event.y;
  				 myImage.style.left = event.x;
  			 }
  		 }
  		 function stay()
  		 {
  			 if (sit == 1)
  			 {
  				 sit = 0;
  				 myImage.style.top = event.y;
  				 myImage.style.left = event.x;
  			 } else {
  				 sit = 1;
  			 }
  		 }
  
  		 document.ondblclick = stay;
  		 document.onmousemove = follow;
  
  		 // -->
  	  </script>
     </head>
  
     <body style = "background-color: wheat">
  
  
  	  <img id="myImage" src = "orange.gif" style = "position: absolute;
  		 top: 100; left: 100" alt="orange" />
  
     </body>
  </html>

this is the one way if there is another please help
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.

Last edited by big_k105; Apr 29th, 2005 at 12:00 PM.
big_k105 is offline   Reply With Quote