By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,837 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,837 IT Pros & Developers. It's quick & easy.

How can I invoke the context menu from javascript?

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
In article <a9**************************@posting.google.com >,
mi***********@mail.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+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. ;)

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

Jul 23 '05 #2

P: n/a
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

P: n/a
> > 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

P: n/a
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

P: n/a
> >>> 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

P: n/a
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.org/>.
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:

<news:40**************@PointedEars.de>

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

PointedEars
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.