Closed Thread Icon

Preserved Topic: Nullifying right mouse button?? Pages that link to <a href="https://ozoneasylum.com/backlink?for=17975" title="Pages that link to Preserved Topic: Nullifying right mouse button??" rel="nofollow" >Preserved Topic: Nullifying right mouse button??\

 
Author Thread
bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-18-2001 00:41

So I am trying to kill the right-mouse button, Here is the basic code.

if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;


function click(e) {
if (document.all) {
if (event.button == 2) {
alert('haaalooo');
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert('haaalooo');
return false;
}
}
}


Okay now this works fine. However I don't want an alert when someone right mouse's on the page Iwant it to set a couple of things in motion. The problem I'm having is when I use don't use an alert, the return false part doesn't work so the menu shows up (actually apparently this only occurs for me in IE). Has any one else dealt with this?

I'm using IE 5.5 on Win 2K
BTW I'm not trying to hide my HTML.


Walking the Earth like Kane

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 05-18-2001 00:57

For IE5+ and Mozilla0.9+ use this:

<BODY ONCONTEXTMENU="return false;"></BODY>

Simple, huh?

Barry
Bipolar (III) Inmate

From: Arcata, CA, USA
Insane since: Aug 2000

posted posted 05-18-2001 01:01

But why? I think that has to be one of the dumbest things to do on a web site. It's very frustrating. I see no point in putting that kind of thing in a web page.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-18-2001 01:02

Cool dealio works like a charm thanks max
Ahh simlultaneous posts.

Barry I told you this isn't to hide code.
I'm working on a new version of my site and I want my nav to be attached to my right mouse button

click here and then click and hold your right mouse button.

Still have a ways to go but thats the start.



Walking the Earth like Kane

[This message has been edited by bitdamaged (edited 05-18-2001).]

kars10
Bipolar (III) Inmate

From: Europe
Insane since: Mar 2001

posted posted 05-18-2001 02:58

somebody in the asylum ring has a right mouse click lock....
i'll try to find it...


only change remains

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-18-2001 06:58

np
Max's code did the trick


Walking the Earth like Kane

Rinswind 2th
Maniac (V) Inmate

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

posted posted 05-18-2001 22:26

err bitdamaged msie complains:
line: 220
char: 2
error: 'onavCont' not defined
code: 0

and
line: 250
char: 3
error: 'onavCont' not defined
code: 0

and no the right mouse button doesn't work...not even after holding it
good luck

Do Not under estimate the power of JOHN DOE

« BackwardsOnwards »

Show Forum Drop Down Menu