How can I invoke the context menu from javascript?

M

Michel

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?
 
K

kaeli

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+javascript&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. ;)

--
 
T

Thomas 'PointedEars' Lahn

Michel said:
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
 
M

Michel

Can I invoke the context menu from javascript so I can have it
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.
 
T

Thomas 'PointedEars' Lahn

Please include a short attribution line like the following next time.
It makes discussions easier to follow.
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
 
M

Michel

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 :(
 
T

Thomas 'PointedEars' Lahn

Michel said:
[...] 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 said:
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.javascript where I posted
the URIs and the keywords used to find them:

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


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top