473,804 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I invoke the context menu from javascript?

Can I invoke the context menu from javascript so I can have it
disabled on 1 right-click, but show it on a double right-click or
vice-versa?
Jul 23 '05 #1
6 2577
In article <a9************ **************@ posting.google. com>,
mi***********@m ail.com enlightened us with...
Can I invoke the context menu from javascript so I can have it
disabled on 1 right-click, but show it on a double right-click or
vice-versa?


There is a way to disable it on right click, but it isn't recommended
for an internet application because people with disabilities need it to
navigate and because it irritates people. Plus, there is a very easy way
to get around such things. Also, people are used to interfaces. They
don't like being confused when you change them. Changing familiar
interfaces loses visitors.

Okay, all that said...

I'm pretty sure double-click events are not cross-browser. Is this an IE
application?

There is plenty of stuff on using and customizing the context menu.
GIS: http://www.google.com/search?
q=contextmenu+j avascript&btnG= Search&hl=en&lr =&ie=UTF-8

As a Netscape 7 user, I can tell you that our intranet application that
is supposed to customize the context menu, doesn't for me. So, if your
users have browsers other than IE, do remember to test in them. ;)

--
--
~kaeli~
Practice safe eating - always use condiments.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Michel wrote:
Can I invoke the context menu from javascript so I can have it
disabled on 1 right-click, but show it on a double right-click or
vice-versa?


Unless you provide reasons I find valid I will not even try to suggest
how that could *possibly* be done in *some* user agents because not
supporting this course of action and eventually hiding the required
information from anyone who does not know it and reads this posting
hopefully makes the Web a better place to be.

So my answer is only that:

1. Double-clicking is a Bad Thing from an ergonomic perspective
as it is likely to support RSI (Repetitive Strain Injury).
It seems foolish to force users to right-double-click for a
normal function of their software that they are used to work
with one click (possibly on another mouse button, for example
the left one in Opera).

2. There are more way to access a context-sensitive menu than
clicking a mouse button, depending on the user agent and
the GUI/application framework. Your method is flawed if it
does not also cover these access points, and what they are
you cannot know.

3. Do not ever mess with the software of your users (unless you
are really really sure that you know what you are doing).
PointedEars
Jul 23 '05 #3
> > Can I invoke the context menu from javascript so I can have it
disabled on 1 right-click, but show it on a double right-click or
vice-versa?


Unless you provide reasons I find valid I will not even try to suggest
how that could *possibly* be done in *some* user agents because not
supporting this course of action and eventually hiding the required
information from anyone who does not know it and reads this posting
hopefully makes the Web a better place to be.


I just want to add special settings onder the right-button without
completly disable the normal right-button context-menu.
I skipped the idea of doublecliking but want my ownmenu show up as
long as the right-click doens't release. So when a user rightclicks
and hold the button down it shows a special menu and maybe even all
the shortcut's and site-navigations. As soon as the right mousebutton
is released and if the mouse hasn't moved down the special menu, the
normal contextmenu should show up.
Jul 23 '05 #4
Please include a short attribution line like the following next time.
It makes discussions easier to follow.

Michel wrote:
Can I invoke the context menu from javascript so I can have it
disabled on 1 right-click, but show it on a double right-click or
vice-versa?


Unless you provide reasons I find valid I will not even try to suggest
how that could *possibly* be done in *some* user agents because not
supporting this course of action and eventually hiding the required
information from anyone who does not know it and reads this posting
hopefully makes the Web a better place to be.


I just want to add special settings onder the right-button without
completly disable the normal right-button context-menu. [...] So
when a user rightclicks and hold the button down it shows a special
menu and maybe even all the shortcut's and site-navigations. As soon
as the right mousebutton is released and if the mouse hasn't moved
down the special menu, the normal contextmenu should show up.


Ahhh, that reads much different. Well, if you want to *extend* the
context menu it will do no harm and as such it can be quite easily
accomplished, but only in some browsers. I have not much time right
now to explain how, but IIRC I have posted URIs to solutions for
Mozilla/5.0 and IE 5+ here before. Google (Groups) is your friend.
[psf 6.1]
HTH

PointedEars
Jul 23 '05 #5
> >>> Can I invoke the context menu from javascript so I can have it
disabled on 1 right-click, but show it on a double right-click or
vice-versa?

Unless you provide reasons I find valid I will not even try to suggest
how that could *possibly* be done in *some* user agents because not
supporting this course of action and eventually hiding the required
information from anyone who does not know it and reads this posting
hopefully makes the Web a better place to be.


I just want to add special settings onder the right-button without
completly disable the normal right-button context-menu. [...] So
when a user rightclicks and hold the button down it shows a special
menu and maybe even all the shortcut's and site-navigations. As soon
as the right mousebutton is released and if the mouse hasn't moved
down the special menu, the normal contextmenu should show up.


Ahhh, that reads much different. Well, if you want to *extend* the
context menu it will do no harm and as such it can be quite easily
accomplished, but only in some browsers. I have not much time right
now to explain how, but IIRC I have posted URIs to solutions for
Mozilla/5.0 and IE 5+ here before. Google (Groups) is your friend.
PointedEars


I don't know what you mean with IIRC or URIs? But I did look around on
google and I still didn't find a way to trigger the pop-up of the
context-menu from javas script :(
Jul 23 '05 #6
Michel wrote:
[...] Well, if you want to *extend* the context menu it will do no
harm and as such it can be quite easily accomplished, but only in some
browsers. I have not much time right now to explain how, but IIRC I
have posted URIs to solutions for Mozilla/5.0 and IE 5+ here before.
Google (Groups) is your friend. [...]
I don't know what you mean with IIRC or URIs?


I don't know if you don't know, so don't ask me ;-)

IIRC: If I Recall/Remember Correctly. Common Usenet jargon.
See <http://www.catb.org/~esr/jargon/> et al.

URI: Uniform Resource Identifier. Informal: Internet address.
See `URL'.

You should bookmark <http://en.wikipedia.or g/>.
But I did look around on google and I still didn't find a way
to trigger the pop-up of the context-menu from javas script :(


The language is called JavaScript and has nothing to do with Java.

I confused this group with de.comp.lang.ja vascript where I posted
the URIs and the keywords used to find them:

<news:40******* *******@Pointed Ears.de>

Found out some time before, sorry for the delay, I just forgot it.
HTH

PointedEars
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1433
by: Michel | last post by:
I like to show a inbetween selfmade menu when rightclicking the page. So on the first line I want to add "Default right-click menu". So first I need to capture it, then I need to stop the context-menu from showing up, then show a self designed pop-up menu and then I need to be able to activate the real client-site context-menu from this menu without clicking the right mouse button. Any idee welcome, thanks!
8
10104
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for a text box has 6 items, undo, cut, copy, paste, delete and select all. I would like to add one additional paste menu that opens a new sub menu with several optional text items that could be pasted. The items would be populated by my program but...
1
1223
by: Craig | last post by:
what are the advantages/disadvantages of using a .net context menu vs using the javascript one that I can create in Macromedia Fireworks? I'm not familiar with the .net context menu.
0
1523
by: Lesley | last post by:
How can I invoke the standard Windows Shell Context menu for a file or folder from vb.net? I have a treeview with nodes in it representing files and folders, as in windows explorer and when I right-click on a node I would like to call the usual context menu that you get in explorer. I have found lots of articles on the web detailing how to add items to the context menu for explorer, but not how to access it from VB.net Lesley
3
3882
by: brisco5 | last post by:
I have a TEXTAREA element. A user right clicks within in to get the context menu and they select "paste". I want my javascript code to know that they selected "paste". I know you can capture the mouse click, but can we capture exactly what event that attempted? Thanks, Mike
2
2417
by: Robbo | last post by:
Hi, I am creating html pages with forms where I use Dynarch menu script in a context menu mode. Their script needs to be initialized like this: <body onload="DynarchMenu.setup('menu', { context: true });"> This is in the beginning of the html page. But, in my webpages I have only few pages where I actually use this kind of menu. Since I use smarty template engine, I have single html-header file for all pages - it includes the same...
19
3318
by: BibhuAshish | last post by:
Hello, I have created a context menu in mozilla by using following code: function nrc(e) { var contextMenu; document.oncontextmenu = function (evt) { var srcElement; if (evt && evt.target) { srcElement = evt.target;
1
1352
by: chandan | last post by:
Hi, I am in search of a control that can save image form my webpage. On that web page I am using my own context menu and I disabled the default context menu of IE. Now I want the same functionality as given by IE context menu item save Image as! So tell me how IE works in that case?? Which API or function calls IE when clicking on their context menu Item Save Image As..?
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.