spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / diner / contextmenu
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

DHTML Diner Logo

Disabling the Context Menu



Explorer for Macintosh

As mentioned, Explorer for the Macintosh regards the context menu to be connected to the mousedown event. We also saw that any element can have the context menu disabled by returning false from its mousedown event. Unlike Navigator, Explorer allows the mousedown event for all elements, with very few exceptions, so authors have many more options for page customization, as regards the context menu.

To turn off the context menu for all elements in a page, IE for Macintosh requires only a function to be assigned to the document's event handler!

document.onmousedown = function(){}

The above suffices, although for good form we should enter a return value:

document.onmousedown = function(){return false}

Note:
The above will turn off the context menu for all elements. If you want to turn it off for a few elements only, then apply mousedown handlers to those elements only.

But, what about Explorer for Windows?


Produced by Peter Belesis and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

All Rights Reserved. Legal Notices.
Created: April 28, 2000
Revised: April 28, 2000

URL: http://www.webreference.com/dhtml/diner/contextmenu/3.html