By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

problem with Button behaviour

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.