Hello,
I am trying to have the mouseover event continue the entire time the mouse is over the hyperlink.
right now when the mouseover event is triggered, it tells an object to move 5 pixels, but it happens only once.
My goal is to have the object move 5 pixels at 0.5 second intervals while the mouse is over the hyperlink. It should not stop untill the mouse moves from the hyperlink.
Is there anyway to loop the mouseover event (or any event) until told to stop?
Heres an example of the code i have so far:
<html>
<head>
<script>
function funMovDis(obj, x, y){
obj = document.getElementById(obj);
obj.style.left=parseInt(obj.style.left)+x+”px”;
obj.style.top=parseInt(obj.style.top)+y+”px”;
}
</script>
</head>
<body>
<img src =”circle.gif” id = ‘obj2’ style=”position: absolute; left: 150px; top: 280px”>
<a href=”#” onmouseover=”funMovDis(‘obj2’, 0, -5);”>UP</a>
<a href=”#” onmouseover=”funMovDis(‘obj2’, 0, 5);”>DOWN</a>
<a href=”#” onmouseover=”funMovDis(‘obj2’, -5, 0);”>LEFT</a>
<a href=”#” onmouseover=”funMovDis(‘obj2’, 5, 0);”>RIGHT</a>
</body>
</html>