Closed Thread Icon

Topic awaiting preservation: handle the right-click mouse event (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8939" title="Pages that link to Topic awaiting preservation: handle the right-click mouse event (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: handle the right-click mouse event <span class="small">(Page 1 of 1)</span>\

 
Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 11-10-2003 15:11

Hi, I'm trying to handle the right-click mouse event on NS6+ avoiding the default behavior of the browser.
Following is the way I've attached to the event and the handling function (excluding the browser compatibility code).
function myFunc(e){
if (e.which != 3) {
return true;
}
...
return false;
}

document.addEventListener("mousedown", myFunc, false);
It looks like I'm getting the browser default right-click menu after all when the mouse is up again.
I tried to do the same for the "mouseup" event but I'm still getting the default menu.


Rinswind 2th
Maniac (V) Inmate

From: Den Haag: The Royal Residence
Insane since: Jul 2000

posted posted 11-10-2003 19:06

Are you realy shure you want this?
sounds like hijacking the right-click menu to me...

Maybe you could use an a ALT-Right click or an CTRL-Left click for this function. So people won't get angry at you about messing with their controls and keep coming to your site.

Take a look at this ALA-article

__________________________________________
"Art has to be forgotten. Beauty must be realized."
Piet Mondriaan

Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 11-10-2003 19:34

The reason for my request is for creating a generic JS library for popup menus therefore I really sure i want to get rid from the default menu.

« BackwardsOnwards »

Show Forum Drop Down Menu