🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.inetsdk.programming.scripting.jscript
Article #11

Re: event handler for right mouse button in JS, possible?

#11
From: Claude Pelletier
Date: Wed, 29 Sep 1999 00:00
49 lines
2607 bytes
Put that in the header of your page :

var NS4   = (document.layers) ;
var IE4    = (document.all) ;
var IE5    = (navigator.userAgent.indexOf("MSIE 5")>= 0);

function Clique(e){
  if ((NS4 && e.which==3) || IE5 || (IE4 && event.button==2)){
    if(IE4 && !IE5){
       var message =  "L'action du bouton droit de la souris a �t�\n" ;
       var message =  "neutralis�e dans cette partie de la page." ;
       alert(message) ;
   }
    return false;
  }
}
// --------------------------------------------------------------------
if((IE4 || NS4) && !IE5)document.onmousedown = Clique;
if(NS4) document.captureEvents(Event.MOUSEDOWN) ;
if(IE5) document.body.oncontextmenu = Clique;



--
Claude Pelletier
Programmeur, analyste et formateur en informatique
Montr�al (Qu�bec)
clope@total.net

R�alisations sur le web (plusieurs sont en construction) :
    http://www.total.net/~mdjrdp/index.html (DHTML)
    http://www.total.net/~clope/CV/index.html (DHTML)
    http://www.total.net/~clope/indexa.html (DHTML)
    http://www.total.net/~clope/index.html (conventionnel)
    http://www.ccdmd.qc.ca/agora.html (DHTML, SQL)


Rafael Rasinger <rasinger@atc.co.at> wrote in message
news:37f1c30a@news.kapsch.co.at...
> Dear reader!
>
> I am looking for the posibilty to uo use these JS-event handlers, but for
> the RIGHT mouse button. Is there a way to do it?
>
> Thank you!
>
>  Rafael
>
>
Technical Details
Message-ID: <QnwI3.33769$Hb3.112271@news.total.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37f1c30a@news.kapsch.co.at>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10d4a5,ac438531d738d94e
X-Google-Attributes: gid10d4a5,public
X-Google-Thread: 10731d,ac438531d738d94e
X-Google-Attributes: gid10731d,public
X-Google-Thread: fb3cb,ac438531d738d94e
X-Google-Attributes: gidfb3cb,public
X-Google-Thread: fcc66,ac438531d738d94e
X-Google-Attributes: gidfcc66,public
X-Google-Thread: 10c71c,ac438531d738d94e
X-Google-Attributes: gid10c71c,public
From: "Claude Pelletier" <clope@total.net>
Subject: Re: event handler for right mouse button in JS, possible?
Date: 1999/09/29
Message-ID: <QnwI3.33769$Hb3.112271@news.total.net>
X-Deja-AN: 530897876
References: <37f1c30a@news.kapsch.co.at>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.207
X-Complaints-To: abuse@total.net
X-Trace: news.total.net 938644080 216.210.34.51 (Wed, 29 Sep 1999 18:28:00 EDT)
Organization: TotalNet Inc.
X-MSMail-Priority: Normal
NNTP-Posting-Date: Wed, 29 Sep 1999 18:28:00 EDT
Newsgroups: microsoft.public.inetsdk.programming.scripting.jscript,microsoft.public.scripting.jscript,borland.public.intrabuilder.javascript,comp.lang.javascript,de.comp.lang.javascript