MarketSpace Technologies, Inc. Logo

MarketSpace Technologies, Inc. - Right Mouse Capture Script for IE 5.0

 

 MST Homepage
 About MST
 MST Newsletter

 MST Resources
 mstSBuilder - Custom Script Generator
 100+ Free Backgrounds
 Over 150 Free Ad Sites!
 Essential Links
 Join our Link Share Program
 iNet related Tips and Tricks

 Search MST or the Web
 Contact MST

This site is Microsoft Internet Explorer 4.0x enhanced.
This site is Netscape Navigator 4.0x enhanced.
Customize your site the easy way!  mstSBuilder custom script generator.
Vote this site as a Starting Point HotSite

. Location: MST Home / Resources / Tips and Tricks / Right Mouse Capture

MST 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 ]

.  


Related Topics

. Forms:
CGI-Less Forms

Browser Tips:
Browser Redirection
Frame Removal
Remote Window
Right Mouse Capture

Hyperlinks:
Text Mouseovers

Graphics Tips:
Faster Loading Graphics
Backgrounds for All Resolutions

Scripts:
Status Bar Message
Confirmation Dialog
Clock on a Button
Text Field Clock

.

 

Copyright © 1997-2000, MarketSpace Technologies, Inc.
All Rights Reserved.