Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2003, 08:26 PM   PM User | #1
chubbysilk
New to the CF scene

 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
chubbysilk is an unknown quantity at this point
Created a context menu, having trouble getting it to disappear.

Hello,
I am implementing a context menu for the nodes of a tree control in my web page. For the most part, it is working. When I right click, the appropriate menu appears. The problem is, if I right click again immediately after that, the first menu remains, and then the general IE menu comes up. I would like to change this so that when I right click a second time, no matter where it is, the context menu disappears. And I'd rather not see the IE menu at all. Does any one know how to do this? Here is the main part of the code that I used to implement this:

function seeDirMenu()
{
DirMenu.style.posLeft = event.clientX;
DirMenu.style.posTop = event.clientY;
DirMenu.style.display = "inline";
DirMenu.setCapture();
}

function clickDirMenu()
{
DirMenu.releaseCapture();
DirMenu.style.display = "none";
}

function switchMenu()
{
el=event.srcElement;
if (el.className=="menuItem") {
el.className="highlightMenuItem";
}
else if (el.className=="highlightMenuItem") {
el.className="menuItem";
}
}

<div id="DirMenu" onclick="clickDirMenu()" onmouseover="switchMenu()" onmouseout="switchMenu()" >
<div class="menuItem" id="goLive" align="left">Go Live</div>
</div>

<span oncontextmenu="seeDirMenu(); return false">
<asp:HyperLink Target="edit" NavigateUrl='url' Runat="server" ID="hl2">Hyperlink Name
</asp:HyperLink>
</span>


Thanks for your help,
RC
chubbysilk is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:25 AM.


Advertisement
Log in to turn off these ads.