Menu item without specifying url?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Wade
Beginner
Beginner
Posts: 1
Joined: Thu Nov 29, 2007 8:53 pm

Menu item without specifying url?

Post by Wade »

Hello,

I'm new to web design (a little lost...) - sorry if this post is a little crazy...

I want to create a web site using one of your menus. I see typically that most menus (including yours) point to url's which I would take you to an entirely new "page".

I'm envisioning one "page" (header, main body, and footer). The "main body" would have "default content". Then, by selecting a menu item, the "main body" would have different "content" - by specifying different "div" tags in each menu item.

Is this possible? Are there examples?

Thanx, Wade
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Menu item without specifying url?

Post by Ruth »

Hi,

The only way I know to do that is to put an iframe inside the div. Here's an example page. You will also need to create a page1.htm which is the original page that is in the iframe and a page2.htm which is the one that will be loaded when you click the item to load the page in the div's iframe. I put padding on the div and a border, and also an frameborder so that these would show when viewed.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<script type="text/javascript" src="milonic_src.js"></script>	
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="menu_data.js"></script>
	
<script>
function openIFrame(iFrameId,winURL)
{
	ifId=gmobj(iFrameId)
	ifId.src=winURL
}
</script>
<div id="layer1" style="position:absolute; left:110px; top:50px; width:600px; height:200px; z-index:1;padding:4px;border:1px solid red"><iframe id=tempiframe name=tempiframe width="100%" height='100%' frameborder=1 src="page1.htm"></iframe></div>
</body>
</html>
Add this item to your menu_data file to test the page load in the iframe.

Code: Select all

aI("text=Load page into div's iframe;url=page2.htm;target=tempiframe;");
I know there are methods to load a div, js functions I believe, and also I think ajax does it, but I think that might also use js functions or an iframe. But, don't take it to the bank, what I know about js would fit on the head of a pin :)

There is also something called a div loader that you can check here Some of the things at this site require a license purchase. I believe this item is free as long as you post their notice as creator. Again, I don't know that this will load a page. I believe it's only content.

Ruth
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Menu item without specifying url?

Post by Ruth »

I just thought of something else you can do. You could create divs and set up a function to show hide them using the menu to do it. That way you could show different content from a click on the menu, however, you can't load an html page into a div, as far as I know.

Ruth
Post Reply