🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: rightclick of links, buttons, etc..

#15
From: Rafael Rasinger
Date: Mon, 04 Oct 1999 00:00
55 lines
2425 bytes
Dear Crazy like a fox!

Thanks a lot for ur answer! It helped me a lot!

> if (event.srcElement.classname == something)....
> you have to put a class attribute named 'something' in the elements you
> are going to click on
> there are other ways to do this of course but this is a simple one

I have a last question concerning
the possibility of starting a function when a link, button, etc. is
rightclicked (when leftclicked a default action is performed e.g. page is
called)?

What would be the source code for the from u above mentioned example "if
(event.srcElement.classname == something)...." below (when I press the
button)?


***************
<HTML>
<BODY>

<SCRIPT LANGUAGE=javascript>

if (document.layers)
    document.captureEvents(Event.MOUSEDOWN);

  document.onmousedown =
      function ButtonClick(evt) {
      if ((document.layers && evt.which == 3) || (document.all &&
event.button == 2))
      {

window.open("help.html#Insert","HELP","height=400,width=800,status=no,scroll
bars=yes");
       return false;
       event.returnValue = false;
      }
    else openlocation(...);
     };

</SCRIPT>

<FORM>
<input type=button value="push" onMousedown="ButtonClick()">
</FORM>

</BODY>
</HTML>
***************

Thank you!

Regards, Rafael
Technical Details
Message-ID: <37f86351@news.kapsch.co.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37f4b2f4@news.kapsch.co.at> <37F4BF81.344FFDB1@sw.seisy.abb.se>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d4a5,5999b3778b037568
X-Google-Attributes: gid10d4a5,public
X-Google-Thread: 10731d,5999b3778b037568
X-Google-Attributes: gid10731d,public
X-Google-Thread: fb3cb,5999b3778b037568
X-Google-Attributes: gidfb3cb,public
X-Google-Thread: 10c71c,5999b3778b037568
X-Google-Attributes: gid10c71c,public
X-Google-Thread: fcc66,5999b3778b037568
X-Google-Attributes: gidfcc66,public
From: "Rafael Rasinger" <rasinger@atc.co.at>
Subject: Re: rightclick of links, buttons, etc..
Date: 1999/10/04
Message-ID: <37f86351@news.kapsch.co.at>
X-Deja-AN: 532569429
References: <37f4b2f4@news.kapsch.co.at> <37F4BF81.344FFDB1@sw.seisy.abb.se>
X-Original-NNTP-Posting-Host: 193.80.86.140
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@kapsch.net
X-Trace: 4 Oct 1999 10:20:33 +0100, 193.80.86.140
Organization: Kapsch AG; Vienna, Austria
Newsgroups: microsoft.public.inetsdk.programming.scripting.jscript,microsoft.public.scripting.jscript,borland.public.intrabuilder.javascript,comp.lang.javascript,de.comp.lang.javascript