Tobias
11-05-2004, 06:40 AM
Hi!
I have an html image-element that looks like this:
<img
onmousedown="MDownMap ();"
onmouseup="MUpMap ();"
onmousemove="MMoveMap ();"
id="transPic"
style="position:absolute; top:0; left:0; width:630; height:482; visibility:visible; z-index:3; cursor:crosshair;"
src="img/transPix.gif">
The corresponding JavaScript functions are these:
function MDownMap () {mouseDown=true;}
function MUpMap () {mouseDown=false;}
function MMoveMap () {status=mouseDown;}
The onmousemove event fires when i move the cursor over the image and the word "false" can be read in the status bar (IE). The onmousedown event fires when i press the mouse button and the word "true" can be read in the status bar. But when I release the mouse button, after having moved the cursor around with the button down, the status bar still reads "true" which i suppose means the onmouseup event hasn't fired. When I don't move the mouse around while the button is pressed it works just fine.
Does anyone know what's wrong? (I've done a similar thing using SVG instead of HTML and then I didn't encounter this problem)
Regards
Tobias Lennartsson
I have an html image-element that looks like this:
<img
onmousedown="MDownMap ();"
onmouseup="MUpMap ();"
onmousemove="MMoveMap ();"
id="transPic"
style="position:absolute; top:0; left:0; width:630; height:482; visibility:visible; z-index:3; cursor:crosshair;"
src="img/transPix.gif">
The corresponding JavaScript functions are these:
function MDownMap () {mouseDown=true;}
function MUpMap () {mouseDown=false;}
function MMoveMap () {status=mouseDown;}
The onmousemove event fires when i move the cursor over the image and the word "false" can be read in the status bar (IE). The onmousedown event fires when i press the mouse button and the word "true" can be read in the status bar. But when I release the mouse button, after having moved the cursor around with the button down, the status bar still reads "true" which i suppose means the onmouseup event hasn't fired. When I don't move the mouse around while the button is pressed it works just fine.
Does anyone know what's wrong? (I've done a similar thing using SVG instead of HTML and then I didn't encounter this problem)
Regards
Tobias Lennartsson