469,923 Members | 1,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

problem with Button behaviour

Hi

I have different images which i use to simulate a button behaviour.
This looks as follows:

if (document.images)
{
toc1over = new Image(31,54);
toc1over.src = "b go focus.bmp";
toc1down= new Image(31,54);
toc1down.src= "b go down.bmp";
}

function rollPress(imName,down) {
if (down) { document.images[imName].src = toc1down.src }
else { document.images[imName].src = toc1over.src }
}
<img src="b go focus.bmp" class="setact_button" name="toc1"
onMouseDown = "rollPress('toc1',true)"
onMouseOut = "rollPress('toc1',false)"
onMouseUp = "rollPress('toc1',false)"
onclick="javascript:alert('test');">

It works quite fine, but there is a small "problem". Lets say I move
over the button and the i press the mouse button and hold it. As
required the onmousedown event is triggered. If i continue to told the
mouse button down and I move out of the range of the button the
onmouseout event is NOT triggered. Can anybody tell me how the
onmouseout event is triggered although the mouse button is pressed?
Would be very thankful for that!

Best Regards
Christoph

Sep 15 '05 #1
1 1201
ASM
Christoph wrote:
<img src="b go focus.bmp" class="setact_button" name="toc1"
onMouseDown = "rollPress('toc1',true)"
onMouseOut = "rollPress('toc1',false)"
onMouseUp = "rollPress('toc1',false)"
onclick="javascript:alert('test');">

It works quite fine, but there is a small "problem". Lets say I move
over the button and the i press the mouse button and hold it. As
required the onmousedown event is triggered. If i continue to told the
mouse button down and I move out of the range of the button the
onmouseout event is NOT triggered.
of course ! if you forget to leave the mouse !

mouseover and mouseout fires while flying over limits
during your mousedown the browser doesn't look to mousemoving (mouseout)

usually : onmousedown+onmouseup
don't like to work with onclick ... which is same
Can anybody tell me how the
onmouseout event is triggered although the mouse button is pressed?


what does a mousedown ? certainly not a mouseout ...

--
Stephane Moriaux et son [moins] vieux Mac
Sep 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Alastair Anderson | last post: by
2 posts views Thread by SenthilVel | last post: by
7 posts views Thread by Morten | last post: by
6 posts views Thread by ?scar Martins | last post: by
reply views Thread by Stewart Midwinter | last post: by
3 posts views Thread by Veerle | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.