Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Right Click Menu
Stephen Benson
Junior Member

Posts: 7
Registered: 12/24/2002
Member Is Offline
posted on 1/13/2003 at 04:56 PM Reply With Quote
Right Click Menu


Not really a Tigra question, but I've had some good answers here, so I thought I'd ask.

It looks like I'm going to have to move to an applet -- I'm now being asked to add a right click menu with configurable entries (maybe even dynamically configurable) -- ie commands related only to our web app.

All I've found so far respond to right clicks anywhere on the page, whereas I want to just fire on node URIs -- and each site will have different targets.
View User's Profile View All Posts By User U2U Member
Ulukai
Member

Posts: 40
Registered: 11/27/2002
Location: Frankfurt, Germany
Member Is Offline
posted on 1/13/2003 at 08:10 PM Reply With Quote

interesting problem:)

As there seems to be no event-handler named onrightclick for html-elements, you may have to work around.

I guess you already know about "which" (Netscape) and "event.button"(IE) to determine the mousebutton pressed. So I will not go into this stuff.

An idea is to define a mouseover and mouseout for each element.
When the user enters or leaves an element it will be stored for example in a global variable.
When capturing a global mousedown or mouseup event you only have to look up this variable to know which element has been right clicked.




....

My Paragraph




I did not test this code. It was only meant to explain the idea. I would write a control-class, handling these events.

I hope, I could help you.
Have fun

Ulukai
View User's Profile View All Posts By User U2U Member
Ulukai
Member

Posts: 40
Registered: 11/27/2002
Location: Frankfurt, Germany
Member Is Offline
posted on 1/13/2003 at 08:18 PM Reply With Quote
How to disable the normal contextmenu


I forgot to talk about disabling the normal context menu. I didn?t want to set up the code now, so I took a script from Michael Mailers JavaScripts and translated the comments and strings from german to english:

//this script comes from Michael Mailers JavaScripts
//URL: http://www.webaid.de/js -- eMail: mm[at]webaid[dot]de
//Please do not erase this comment

if (document.layers){
window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
window.onmousedown=rightclick;
window.onmouseup=rightclick;

function rightclick(e) {
if (e.which == 3) {
// Put right mouse code here
alert('Sorry: This function is deactivated.');
return false;
}
else {
return true;
}
}
}
if (document.all){
function click() {
if (event.button==2) {
alert('Sorry: This function is deactivated.')
}

if (event.button==3) {
alert('Sorry: This function is deactivated.')}
}
document.onmousedown=click
}


CU

Ulukai
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Tree Menu
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   
Tigra Tree Menu PRO
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004