Right click menu functionality

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Nunners
Forum Commoner
Posts: 89
Joined: Tue Jan 28, 2003 7:52 am
Location: Worcester, UK
Contact:

Right click menu functionality

Post by Nunners »

I'm creating a number of applications using php and (obviously) html/javascript and one thing that would be nice, and would cause less of a headache in layout, would be the ability to have right-click functionality - like in MS Exchange Web view (it's only on Internet Explorer though).

Can anyone point me in the direction of somewhere that explains how to create right-click-menu functionality in IE & any other browsers, if it's possible?

Thanks
Nunners
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I believe it's called context menu in many areas of discussion.
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

Full HTML Source For Right Click Page

Code: Select all

<html>
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript1.2">
function right_click()
  {
    window.alert("Hello");
    //Your Right Click Statements goes here
    return false;
  }
</script>
</head>
<body>
<script language="JavaScript1.2">
document.oncontextmenu = right_click;
</script>
</body>
</html>
Keep All Your right Click Items In the right_click function

Code: Select all

function right_click()
  {
    window.alert("Hello");
    //Your Right Click Statements goes here
    return false;
  }

Code: Select all

document.oncontextmenu = right_click;//Captures The Right Click
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Typo 3 uses this through out their administration area.
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

Hey Whats Typo 3
Post Reply