Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > FAQ Topic - How do I suppress a context menu (right-click menu)? (2012-02-22)

Reply
Thread Tools

FAQ Topic - How do I suppress a context menu (right-click menu)? (2012-02-22)

 
 
FAQ server
Guest
Posts: n/a
 
      02-22-2012
-----------------------------------------------------------------------
FAQ Topic - How do I suppress a context menu (right-click
menu)?
-----------------------------------------------------------------------

A context menu, often triggered by right-click, can be requested by the
user in a few ways. For example, on windows, shift + F10 and on macs,
click-and-hold. Other input devices exist and mouse buttons can be
configured, making the term "right click" a misnomer, in context.

In browsers that allow it, a script can suppress the context menu by
returning false from an object's `oncontextmenu` event handler.

document.oncontextmenu = function() {
return false;
};

Some browsers lack context menus (e.g. iphone). Browsers that have
context menus do not always have a scriptable event for them. Some
browsers can be configured to disallow scripts from detecting context
menu events (IE, Opera); others may fire the event but be configured to
disallow scripts from suppressing the context menu (Firefox,Seamonkey).

Even when the context menu has been suppressed, it will still be
possible to view/save the source code and to save images.

<URL: http://en.wikipedia.org/wiki/Context_menu>
<URL: http://kb.mozillazine.org/Ui.click_hold_context_menus>
<URL: http://support.microsoft.com/kb/823057>
<URL: http://stackoverflow.com/questions/1870880/opera-custom-context-menu-picking-up-the-right-click/1902730#1902730>
<URL: http://support.mozilla.com/en-US/kb/Javascript#Advanced_JavaScript_settings>
<URL: http://msdn.microsoft.com/en-us/library/ms536914%28VS.85%29.aspx>


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/

--

The sendings of these daily posts are proficiently hosted
by http://www.pair.com.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
add menu item to context (right-click) menu? lcplben Javascript 3 10-30-2009 11:56 PM
FAQ Topic - What questions are on-topic for CLJ? (2008-10-16) FAQ server Javascript 1 10-16-2008 12:03 PM
Can I holdup and activate the context-menu as a sub-menu? Michel Javascript 2 08-02-2004 09:54 PM
Context.Items vs Context.Handler (passing values between pages) VS_NET_DEV ASP .Net 2 05-25-2004 01:16 PM



Advertisments