Forum Moderators: open

Message Too Old, No Replies

Set the mouse status as a variable

         

MartinWeb

4:57 am on Nov 9, 2009 (gmt 0)

10+ Year Member



Hello. Does anyone know how to set if the mouse status is up or down as a variable? Something like-


var mousestatus = ?;
if(mousestatus=="up"){

}
if(mousestatus=="down"){

}

I do know how to use onmouseup and onmousedown, but they will not work for my problem. Thank you for any help.

daveVk

5:20 am on Nov 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if event object if visible then

mouseUp = (event.button==0); // none of mouse buttons pressed

MartinWeb

2:45 am on Nov 12, 2009 (gmt 0)

10+ Year Member



Can you explain further? I am not quite sure what you mean.

daveVk

5:34 am on Nov 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the code you are writing is within an event handler, eg. on####=myCode, then an event object is available. event.button tells you which mouse button(s) are pressed, 0 equals no buttons pressed.

Getting the event object is browser dependent
[webmasterworld.com...]

Show the context in which you are doing this, if you need more help.