Location: MST Home / Resources / Tips and Tricks / Right Mouse
CaptureMST Resources
Tips and Tricks
IE 5.0 Right Mouse Capture Script
Capturing the IE 5.0 Right Mouse Button
The first step is to capture the Right Mouse button in IE 5.0. This is the
easiest step in the whole process, but currently requires that it be added to each
page. To capture the Right Mouse button in IE 5.0, you only need to add oncontextmenu="return false;" within your <body>
tag. It should look something similar to this:
<body oncontextmenu="return false;">
What this does is, instead of displaying the context menu with the click of the Right
Mouse button, it allows the event to go by as if it hadn't even taken place. You
will want to add this into each page that you want this functionality to be removed from.
Note: For pages that contain forms and embedded controls,
you will want to exclude this portion from your pages, otherwise various aspects of your
site may lose expected functionality. This functionality might include copy and
paste into form elements. In pages containing embedded controls, if those controls
offer features accessable through the Right Mouse button, these features would not be
available. Also, note that the oncontextmenu attribute
is not currently supported within the HTML 4.0 specification. If your goal is to
have your site meet the specification, you should avoid using the IE 5.0 portion of this
script.
With IE 5.0 out of the way, lets move on to the slightly trickier browsers. Since
neither of the 4.0x browsers recognize the contextmenu attribute, we have to implement a
different method that performs a similar action.
<< Back ][ Next
>>
[ Top of Page ] |