HTML and CSS Reference
In-Depth Information
Figure 13.37 Mouse was positioned on the left top corner of the div box, 11 px
from left, 50 px from top.
Mouse Buttons. Here we go again with more incompatibilities among browsers! And
the mouse might only have one button, such as the Mac's mouse, or two buttons and a
wheel, or maybe the mouse button properties don't work for all of the buttons. You
will have to work with these properties for the particular browser you are using or
make adjustments to your program to allow for multiple conditions; for example:
if( browser == "Opera" ) {
do this;
else if ( browser == "IE") {
do that;
} . ...
In Example 13.24 the mouse used was a Microsoft mouse and then a Targus mouse
with a left and right button and wheel in the middle. The browsers used were Firefox
and Internet Explorer. Firefox returned a 3 for the right click and a 1 for the left click.
Inter-net Explorer was consistent with Table 13.10. Could it be that running a virtual
window OS on a Mac could make the difference? This is where the confusion really
sets in! The only option is to test all possible button values in your script.
The which (Firefox) and the button (Internet Explorer) properties are used to find out
which mouse button was clicked: the left button, the middle button, or the right button.
Search WWH ::

Custom Search