Click to See Complete Forum and Search --> : Hide default menu on a frameset


Sue Stephen
07-05-2004, 07:35 PM
Hi,
I am developing a web page using frameset (IE 6 sp1).

pagent page:
-------------------
<frameset cols="*,*" frameborder="NO" border="0" framespacing="0">
<frame src="page1.htm" name="leftFrame" >
<frame src="page2.html" name="mainFrame">
</frameset>
-------------------

On page1.htm, I need to show a customized menu instead of the default one when a use right click a link on the page.

page1.htm:
-----------
<a href = "some url" onmouseup = "some show menu function" oncontextmenu="return false;">path3</a>
------------

The code above successfully shows the customized menu by itself if I go to page1.htm.
However, when I go to the parent page, the default menu still shows on top of the customized menu.
I have tried to insert code like "document.oncontextmenu=function(){return false}" in the parent page but it does not work.

Could anyone give some suggestions? Thank you for your help.

Sue

Phil Karras
07-06-2004, 09:33 AM
First, try removing or giving a different page2.html in the parent (frame set) page and see if your default menu goes away. The below minimal page should do fine for this test.

<html>
<head>
<title>Test Page2</title>
</head>
<body>
<h1>Test Page2</h1>
</body>
</html>

I suspect it will, which then means that since page2.html is loaded last it is the one putting the default menu on top of the page1.htm menu.

Assuming that is the case you need to find where page2.hmtl gets the default menu and how to deactivate it.

Sue Stephen
07-06-2004, 11:58 AM
The two child frames do affect each other.
I use an alternative:
In page1.htm:

<a class="link" href="url">path1</a>

In js:
document.oncontextmenu=checkSrc;

function checkSrc(){
if (event.srcElement.className!="link")
return true;
else
{
showMenu();
return false;
}
}
------------------
In this case, when a user right click the link, the customized menu will show up, otherwise the default menu will.

Sue Stephen
07-06-2004, 11:59 AM
Sorry, in the previous post, it should be "the child frames do NOT affect each other.

Phil Karras
07-06-2004, 04:34 PM
Where is the default menu located? How is it loaded?

Sue Stephen
07-06-2004, 05:02 PM
When you right click on a IE browser, you will see a menu.

Phil Karras
07-07-2004, 07:27 AM
That's no help whatsoever, remember Sue we haven't looked at your code how do we know what in the world you're doing? What little you gave us only tells us about the frameset and which files were loaded, not if they also call JS or CSS library files etc.

If you ask general questions you get general answers, if you want help with the code you need to either do the work to locate the offending code or you need to post it so we can look at it.

When I ask where the menu is I mean where in which code file is it located. How does it get loaded means what part of your program calls that function?

I don't need to know to left, right-click, or hover to get the menu, you may need to know that, I don't.

If you can demo the problem with a KISS example that is always best. (KISS = Keep It Short & Simple)

Sue Stephen
07-07-2004, 12:33 PM
Hi,
Thank you for your suggestions. I may have misunderstood your question. I have solved the problem.