Can you right mouse click on a link 
Author Message
 Can you right mouse click on a link
I have seen a number of routines to turn off the right mouse click.  Does
anyone have any sample code that will enable the right mouse click to take
action over a link?

Thanks in advance.



Thu, 09 Sep 2004 13:01:42 GMT  
 Can you right mouse click on a link
I don't have any code, but yes it can be done.

The code that disables a right click essentially calls a function that does
nothing ... or returns false (this is speaking from the perspective of JS).

So, theoretically, you could modify the routine to pick up on the event and
what was clicked ... type=link (etc) ... and therefore do something else in
this instance.

If in doubt, set it up to alert() the type of what was clicked on until you
ascertain what a link returns, then change the alert to an if statement that
picks up on this type.


Quote:
> I have seen a number of routines to turn off the right mouse click.  Does
> anyone have any sample code that will enable the right mouse click to take
> action over a link?

> Thanks in advance.



Thu, 09 Sep 2004 13:05:44 GMT  
 Can you right mouse click on a link
I tell you that you are Mr. Quick Answer tonight.  Thanks for the heads up
on this one as well.  I have gone ahead and posted some code that works
based on your notes for anyone who might want to do it.  It seems to work
real well for me...

<BODY>

<P>This is in the body</P>

<a id=refid name=refid href=#>Dog</a>

</BODY>

<script LANGUAGE="JavaScript">

function disable_right_click(e)
{
    var browser = navigator.appName.substring ( 0, 9 );
    var event_number = 0;
    if (browser=="Microsoft")
        event_number = event.button;
    else if (browser=="Netscape")
        event_number = e.which;

    if ( event_number==2 || event_number==3 )
        {
        alert ("Right Mouse Button Is Disabled - Called from:..." +
window.event.srcElement.id );
        return (false);
        }

    return (true);

Quote:
}

function check_mousekey ()
{
    var mouse_key = 93;
    var keycode = event.keyCode;

    if ( keycode == mouse_key )
        alert ( "Mouse Key Is Disabled" );

Quote:
}

function trap_page_mouse_key_events ()
{
    var browser = navigator.appName.substring ( 0, 9 );

    document.onmousedown = disable_right_click;

    if ( browser == "Microsoft" )
        document.onkeydown = check_mousekey;
    else if ( browser == "Netscape" )
        document.captureEvents( Event.MOUSEDOWN );

Quote:
}

window.onload = trap_page_mouse_key_events;

</script>


Quote:
> I don't have any code, but yes it can be done.

> The code that disables a right click essentially calls a function that
does
> nothing ... or returns false (this is speaking from the perspective of
JS).

> So, theoretically, you could modify the routine to pick up on the event
and
> what was clicked ... type=link (etc) ... and therefore do something else
in
> this instance.

> If in doubt, set it up to alert() the type of what was clicked on until
you
> ascertain what a link returns, then change the alert to an if statement
that
> picks up on this type.



> > I have seen a number of routines to turn off the right mouse click.
Does
> > anyone have any sample code that will enable the right mouse click to
take
> > action over a link?

> > Thanks in advance.



Thu, 09 Sep 2004 13:27:36 GMT  
 Can you right mouse click on a link
Actually, that should be MS. Quick Answer... ;)

: I tell you that you are Mr. Quick Answer tonight.  Thanks for the heads up
: on this one as well.  I have gone ahead and posted some code that works
: based on your notes for anyone who might want to do it.  It seems to work
: real well for me...
:
: <BODY>
:
: <P>This is in the body</P>
:
: <a id=refid name=refid href=#>Dog</a>
:
: </BODY>
:
: <script LANGUAGE="JavaScript">
:
: function disable_right_click(e)
: {
:     var browser = navigator.appName.substring ( 0, 9 );
:     var event_number = 0;
:     if (browser=="Microsoft")
:         event_number = event.button;
:     else if (browser=="Netscape")
:         event_number = e.which;
:
:     if ( event_number==2 || event_number==3 )
:         {
:         alert ("Right Mouse Button Is Disabled - Called from:..." +
: window.event.srcElement.id );
:         return (false);
:         }
:
:     return (true);
: }
:
: function check_mousekey ()
: {
:     var mouse_key = 93;
:     var keycode = event.keyCode;
:
:     if ( keycode == mouse_key )
:         alert ( "Mouse Key Is Disabled" );
: }
:
: function trap_page_mouse_key_events ()
: {
:     var browser = navigator.appName.substring ( 0, 9 );
:
:     document.onmousedown = disable_right_click;
:
:     if ( browser == "Microsoft" )
:         document.onkeydown = check_mousekey;
:     else if ( browser == "Netscape" )
:         document.captureEvents( Event.MOUSEDOWN );
: }
:
: window.onload = trap_page_mouse_key_events;
:
: </script>
:
:
:

: > I don't have any code, but yes it can be done.
: >
: > The code that disables a right click essentially calls a function that
: does
: > nothing ... or returns false (this is speaking from the perspective of
: JS).
: >
: > So, theoretically, you could modify the routine to pick up on the event
: and
: > what was clicked ... type=link (etc) ... and therefore do something else
: in
: > this instance.
: >
: > If in doubt, set it up to alert() the type of what was clicked on until
: you
: > ascertain what a link returns, then change the alert to an if statement
: that
: > picks up on this type.
: >


: > > I have seen a number of routines to turn off the right mouse click.
: Does
: > > anyone have any sample code that will enable the right mouse click to
: take
: > > action over a link?
: > >
: > > Thanks in advance.
: > >
: > >
: >
: >
:
:



Thu, 09 Sep 2004 13:55:01 GMT  
 Can you right mouse click on a link
LOL ... Saturday night,{*filter*} out in the Scripting forum.

I think that should be "Ms. Geeky No Life Quick Answer" ;)

"Alex K. Angelopoulos" <alex_angelopoulos_at_hotmail_dot_com_remove__> wrote

Actually, that should be MS. Quick Answer... ;)


: I tell you that you are Mr. Quick Answer tonight.  Thanks for the heads up
: on this one as well.  I have gone ahead and posted some code that works
: based on your notes for anyone who might want to do it.  It seems to work
: real well for me...
:
: <BODY>
:
: <P>This is in the body</P>
:
: <a id=refid name=refid href=#>Dog</a>
:
: </BODY>
:
: <script LANGUAGE="JavaScript">
:
: function disable_right_click(e)
: {
:     var browser = navigator.appName.substring ( 0, 9 );
:     var event_number = 0;
:     if (browser=="Microsoft")
:         event_number = event.button;
:     else if (browser=="Netscape")
:         event_number = e.which;
:
:     if ( event_number==2 || event_number==3 )
:         {
:         alert ("Right Mouse Button Is Disabled - Called from:..." +
: window.event.srcElement.id );
:         return (false);
:         }
:
:     return (true);
: }
:
: function check_mousekey ()
: {
:     var mouse_key = 93;
:     var keycode = event.keyCode;
:
:     if ( keycode == mouse_key )
:         alert ( "Mouse Key Is Disabled" );
: }
:
: function trap_page_mouse_key_events ()
: {
:     var browser = navigator.appName.substring ( 0, 9 );
:
:     document.onmousedown = disable_right_click;
:
:     if ( browser == "Microsoft" )
:         document.onkeydown = check_mousekey;
:     else if ( browser == "Netscape" )
:         document.captureEvents( Event.MOUSEDOWN );
: }
:
: window.onload = trap_page_mouse_key_events;
:
: </script>
:
:
:

: > I don't have any code, but yes it can be done.
: >
: > The code that disables a right click essentially calls a function that
: does
: > nothing ... or returns false (this is speaking from the perspective of
: JS).
: >
: > So, theoretically, you could modify the routine to pick up on the event
: and
: > what was clicked ... type=link (etc) ... and therefore do something else
: in
: > this instance.
: >
: > If in doubt, set it up to alert() the type of what was clicked on until
: you
: > ascertain what a link returns, then change the alert to an if statement
: that
: > picks up on this type.
: >


: > > I have seen a number of routines to turn off the right mouse click.
: Does
: > > anyone have any sample code that will enable the right mouse click to
: take
: > > action over a link?
: > >
: > > Thanks in advance.
: > >
: > >
: >
: >
:
:



Thu, 09 Sep 2004 21:50:31 GMT  
 Can you right mouse click on a link

Quote:

> LOL ... Saturday night,{*filter*} out in the Scripting forum.

> I think that should be "Ms. Geeky No Life Quick Answer" ;)

Hey! Wasn't it Descarte that said: "I script, therefore I am."

--
torgeir



Fri, 10 Sep 2004 05:58:07 GMT  
 Can you right mouse click on a link
I'm not sure, but I prefer:

"I Script, therefore I'm a hotty."


Quote:

> > LOL ... Saturday night,{*filter*} out in the Scripting forum.

> > I think that should be "Ms. Geeky No Life Quick Answer" ;)

> Hey! Wasn't it Descarte that said: "I script, therefore I am."

> --
> torgeir



Fri, 10 Sep 2004 07:09:08 GMT  
 Can you right mouse click on a link

Quote:

> I'm not sure, but I prefer:

> "I Script, therefore I'm a hotty."

Sounds good to me :)

--
torgeir



Fri, 10 Sep 2004 07:21:57 GMT  
 Can you right mouse click on a link
 I think it was

"VBSCRPTVM, ERGO SVM".

:
: > LOL ... Saturday night,{*filter*} out in the Scripting forum.
: >
: > I think that should be "Ms. Geeky No Life Quick Answer" ;)
:
: Hey! Wasn't it Descarte that said: "I script, therefore I am."
:
: --
: torgeir
:
:



Fri, 10 Sep 2004 07:30:03 GMT  
 Can you right mouse click on a link
Having take a look at her website, I would think
 "I Script, therefore I'm a hotty AND a den mother" would be more appropriate ;)

:
: > I'm not sure, but I prefer:
: >
: > "I Script, therefore I'm a hotty."
:
: Sounds good to me :)
:
: --
: torgeir
:
:



Fri, 10 Sep 2004 07:50:03 GMT  
 Can you right mouse click on a link

try right clicking your email adress below!
(its so easy just add the foloowing in the link:  oncontextmenu="click(); return false;")
cybarber

  I have seen a number of routines to turn off the right mouse click.  Does
  anyone have any sample code that will enable the right mouse click to take
  action over a link?

  Thanks in advance.



Fri, 10 Sep 2004 07:54:48 GMT  
 Can you right mouse click on a link
Whose site? You dinking around with my guys? ;)

You don't want to dig too deep in there ... they're a crazy bunch :p

"Alex K. Angelopoulos" <alex_angelopoulos_at_hotmail_dot_com_remove__> wrote

Having take a look at her website, I would think
 "I Script, therefore I'm a hotty AND a den mother" would be more
appropriate ;)


:
: > I'm not sure, but I prefer:
: >
: > "I Script, therefore I'm a hotty."
:
: Sounds good to me :)
:
: --
: torgeir
:
:



Fri, 10 Sep 2004 07:57:36 GMT  
 Can you right mouse click on a link

Quote:

> Having take a look at her website, I would think
>  "I Script, therefore I'm a hotty AND a den mother" would be more appropriate ;)

There Kolyana goes. One of God's own prototypes. Some kind of high powered mutant never even considered
for mass production. Too weird to live, and too rare to die. - Westclox

--
torgeir



Fri, 10 Sep 2004 08:42:46 GMT  
 Can you right mouse click on a link
Not me - they make me think of Starship Troopers trapped in Quake...

: Whose site? You dinking around with my guys? ;)
:
: You don't want to dig too deep in there ... they're a crazy bunch :p
:
:
:
: "Alex K. Angelopoulos" <alex_angelopoulos_at_hotmail_dot_com_remove__> wrote

: Having take a look at her website, I would think
:  "I Script, therefore I'm a hotty AND a den mother" would be more
: appropriate ;)
:
:


: :
: : > I'm not sure, but I prefer:
: : >
: : > "I Script, therefore I'm a hotty."
: :
: : Sounds good to me :)
: :
: : --
: : torgeir
: :
: :
:
:
:



Fri, 10 Sep 2004 08:53:15 GMT  
 Can you right mouse click on a link
LOL


:
: > Having take a look at her website, I would think
: >  "I Script, therefore I'm a hotty AND a den mother" would be more appropriate ;)
:
: There Kolyana goes. One of God's own prototypes. Some kind of high powered mutant never even considered
: for mass production. Too weird to live, and too rare to die. - Westclox
:
: --
: torgeir
:
:



Fri, 10 Sep 2004 08:52:47 GMT  
 
 [ 19 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Can you right mouse click on a link

2. Cancelling a Right Mouse Button Click

3. disable mouse right-click

4. Mouse Right Click Event

5. no right click mouse with alert

6. Detecting Right Mouse Clicks

7. Mouse Right Click Event

8. Javascript detect a right mouse click?

9. sendkeys right mouse click...

10. Right mouse button click

11. Right Mouse Click

12. pop up menu when right mouse button clicked

 

 
Powered by phpBB® Forum Software