I'm trying to use the right mouse button to open a popup on a specific
element. The popup is triggered by a mouseup event. However, on
mousedown the standard context menu opens. To get around this, I listen
to that event, too, and stop it (preventDefault , stopPropagation ). That
works on Konqueror (and presumably other KHTML-based browsers), but not
on Firefox. The latter still opens its context menu.
My search has turned up literally hundreds of blocker scripts for the
right mouse button. The few I've tested don't appear to work as
advertised with Firefox.
Now, my intention isn't to block my users from doing anything, rather
I'd like to offer them a form of interaction they're used to. In this
case the ability to access the settings of an object by right-clicking
it. Is it possible to make this work across browsers?
Michael
--
Michael Schuerig Thinking is trying to make up
mailto:mi*****@ schuerig.de for a gap in one's education. http://www.schuerig.de/michael/ --Gilbert Ryle 3 10657
Michael Schuerig wrote: I'm trying to use the right mouse button to open a popup on a specific element. The popup is triggered by a mouseup event. However, on mousedown the standard context menu opens. To get around this, I listen to that event, too, and stop it (preventDefault , stopPropagation ). That works on Konqueror (and presumably other KHTML-based browsers), but not on Firefox. The latter still opens its context menu.
Use the oncontextmenu handler, which is supported by both FF and IE:
window.oncontex tmenu = function () { return false; }
JW
Janwillem Borleffs wrote: Michael Schuerig wrote: I'm trying to use the right mouse button to open a popup on a specific element. The popup is triggered by a mouseup event. However, on mousedown the standard context menu opens. To get around this, I listen to that event, too, and stop it (preventDefault , stopPropagation ). That works on Konqueror (and presumably other KHTML-based browsers), but not on Firefox. The latter still opens its context menu.
Use the oncontextmenu handler, which is supported by both FF and IE:
window.oncontex tmenu = function () { return false; }
Thanks, that does it.
Michael
--
Michael Schuerig Those people who smile a lot
mailto:mi*****@ schuerig.de Watch the eyes http://www.schuerig.de/michael/ --Ani DiFranco, Outta Me, Onto You
"Michael Schuerig" <mi*****@schuer ig.de> wrote in message
news:dg******** **@newsreader3. netcologne.de.. . I'm trying to use the right mouse button to open a popup on a specific element. The popup is triggered by a mouseup event. However, on mousedown the standard context menu opens. To get around this, I listen to that event, too, and stop it (preventDefault , stopPropagation ). That works on Konqueror (and presumably other KHTML-based browsers), but not on Firefox. The latter still opens its context menu.
My search has turned up literally hundreds of blocker scripts for the right mouse button. The few I've tested don't appear to work as advertised with Firefox.
Now, my intention isn't to block my users from doing anything, rather I'd like to offer them a form of interaction they're used to. In this case the ability to access the settings of an object by right-clicking it. Is it possible to make this work across browsers?
Why are you trying to immitate desktop software behaviour in a web page?
Big mistake.
Remember web pages are basically just documents - trying to force them to
behave like 'real' software applications is a recipie for disaster.
Beleive me, I learned the hard way.
Either write software and do your right-clicking etc. there, OR write web
pages and accept that they're not designed to support those things.
Owen This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David Hayes |
last post by:
I've made tooltips work in Firefox*, but tooltip doesn't appear at the
specified location until the SECOND time that the user passes the mouse over
the location with the mouseover event. What I want is for the user to be
able to put the mouse over text that gives a year (e.g., "(1932)", "(1946)"
and "(1923)") and see the tooltip to the right...
|
by: James Bond |
last post by:
Hello. My 80+ year old father has recently decided to get his first
computer. Due to his age (and I suspect lack of playing pong as a child
like I did) he lacks the manual dexterity to use a mouse well. He is
frequently missing the left mouse button and hitting the right, or less
often the middle (wheel) buttons. While he is very slowly...
|
by: OtisUsenet |
last post by:
Hello,
I have some onClick events in <a href...> elements, so they get called
when a user clicks on a link.
This works well, and looks like this:
<a onclick="onLinkClick(123);" href="......">foo</a>
Unfortunately, if a user opens the link in a new tab (e.g right
click->open in new tab), my onLinkClick function does NOT get called.
|
by: atn2002 |
last post by:
I'm trying to create a control which when the mouse button gets
pressed on one div an absolute positioned div pops up in
place of the cursor. From there the cursor should interact with
the dialog before the mouse button is released. In other words
one element will catch onmousedown, display the popup, and
the popup element will catch...
|
by: Charlie |
last post by:
I want to detect and act on right button clicks in Firefox. The problem
was I kept getting the context menu pop up on right button clicks, even
when I called event.preventDefault(). I had assumed that this would
prevent the context menu which seems to be the default action. Why does
this not prevent the context menu from popping up?
Someone...
| |
by: marss |
last post by:
Hi,
How can I define in Firefox whether the left mouse button is pressed
when I move mouse over a html element?
The documentation says that "e.button == 0 for standard 'click',
usually left button"
http://developer.mozilla.org/en/docs/DOM:event.button
Tracing of mouse clicks or mousedown/mouseup events looks not
reliable, because mouse can...
|
by: Louis |
last post by:
Thanks in advance for any comment and suggestion...
On one of my web pages, I use javascript to pop up a context menu box
when the right-mouse button is clicked on a link. It works fine in
Firefox 2.
When I upgraded to Firefox 3.0, I found out that when I right-mouse
click on the same link, it will pop up my context menu as well as the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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...
| |
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |