M
marss
Hi,
How can I define in Firefox whether the left mouse button is pressed
when I move mouse over a html element?
The documentation says that "e.button == 0 for standard 'click',
usually left button"
http://developer.mozilla.org/en/docs/DOM:event.button
Tracing of mouse clicks or mousedown/mouseup events looks not
reliable, because mouse can be pressed elsewhere out of the html
element (even outside of the browser) and then move over the html
element.
Maybe exists a better way to do it?
Here the test that reproducing the problem.
<head>
<script type="text/javascript">
function test(e)
{
if (e.button == 0)
document.getElementById("d").innerHTML = "Left mouse button is
pressed";
}
</script>
</head>
<body>
<div onmousemove="test(event)" style="height:50px;background-
color:gray"></div>
<div id="d"></div>
</body>
How can I define in Firefox whether the left mouse button is pressed
when I move mouse over a html element?
The documentation says that "e.button == 0 for standard 'click',
usually left button"
http://developer.mozilla.org/en/docs/DOM:event.button
Tracing of mouse clicks or mousedown/mouseup events looks not
reliable, because mouse can be pressed elsewhere out of the html
element (even outside of the browser) and then move over the html
element.
Maybe exists a better way to do it?
Here the test that reproducing the problem.
<head>
<script type="text/javascript">
function test(e)
{
if (e.button == 0)
document.getElementById("d").innerHTML = "Left mouse button is
pressed";
}
</script>
</head>
<body>
<div onmousemove="test(event)" style="height:50px;background-
color:gray"></div>
<div id="d"></div>
</body>