Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:42

Target if using frames


Poster: Ruth
Dated: Friday February 20 2004 - 13:50:03 GMT

I was messing with the unsupported frames code and figured out how to use the function and everything, but what if your 'main' menu also had just a plain link in it, could you get it to open in a particular frame, like you have the submenus open, and if so how would you do that?

Ruth


Poster: kevin3442
Dated: Friday February 20 2004 - 18:11:01 GMT

Hi Ruth,

Specify the target frame in the URL field of the menu item definition.
Code:
,"Home","mainpage.htm target=main",,,1

If I recall correctly, there's no need to specify the sourceframe unless the item is opening a submenu in a different frame, although with some builds, if you didn't put in a sourceframe anyway, like this
Code:
,"Home","mainpage.htm target=main;sourceframe=main",,,1

then the offbgcolor would remain.

Ummm... Should we move this to the v3 forum? ;)

Cheers,

Kevin


Poster: Ruth
Dated: Friday February 20 2004 - 20:28:05 GMT

Hmm, no it's with version 5. I was playing with the function that Hergio threw together for all those who were asking about using 5 with frames to see what was up. It only refers to opening sub menus so I wondered how would you just open a link in that frame if one of your menu items didn't have a submenu but was only a direct link to a page.

Ruth


Poster: kevin3442
Dated: Friday February 20 2004 - 20:40:33 GMT

Oh, I see. You even mentioned "unsupported frames code" although I could have sworn that it said "frames example". Oops. :oops: Sorry.

I guess you'd just have to set the target property for that menu item to the name of the frame where you want the url to appear. For example, say the menu item was in your nav frame, and your content shows up in a frame named "main". Your menu item might look like so:
Code:
aI("text=Home;url=mainpage.htm;target=main;");

Haven't really played with v5 in frames, so this is just conjecture.

Kevin


Poster: Ruth
Dated: Friday February 20 2004 - 21:13:51 GMT

Just for your info, that doesn't work, but it's not a big deal, I'm not making a frames site [though I'm one of those that thinks there are instances when frames are the best option], I was just messing around trying to learn things. Thanks :)

Ruth


Poster: kevin3442
Dated: Friday February 20 2004 - 22:04:57 GMT

Hi Ruth,
Quote:
...that doesn't work...

Well now I found that odd. Seems like it ought to work, right? So you know what I had to do... Not being one to resist, I tried it myself. Only thing is... it worked in IE5/5.5/6, NS7.1, Moz1.2.1, and Opera7.20 in Win2k. At the risk of sounding silly... Are you using the name of your content frame in the target property? In my example, I used target="main" because within my <frameset>, the <frame> holding the content is set to name="main". So if your content frame is named something else, you'd have to use that name instead. E.g., consider the following frameset:
Code:
<frameset rows="50,*">
  <frame name="nav" scrolling="no" noresize src="nav.htm">
  <frame name="body" scrolling="no" noresize src="body.htm">
</frameset>

In this case, there are two frames named "nav" and "body". The main menu would be loaded into the file called nav.htm, which is displayed in the "nav" frame. Main menu items that do not open submenus would set target=body to open pages in the "body" frame, like so:
Code:
aI("text=Products;url=products.htm;target=body;");

In this case, we use target=body because that's the name given to the frame where we want to display the page. If that doesn't work for you, then there's more to the puzzle and I'm left wondering what browser/os you're using?

Cheers,

Kevin


Poster: Ruth
Dated: Saturday February 21 2004 - 1:59:08 GMT

Just slap me upside the head. It helps if you actually put the danged page into the url. :oops: It actually works perfectly. I think I will take a vacation.

Ruth


Poster: kevin3442
Dated: Saturday February 21 2004 - 3:40:41 GMT

I won't slap you upside the head if you won't slap me upside the head for thinking that you were talking about v3 at the top of the thread!

Just to continue (because you got me curious), I tried the frames thing in a couple of other browsers. It did not work in IE4.01, NS4.75, and Opera6.05 (Win2k). I put a <base target="body"> tag in the <head> section of nav.htm and that worked for IE4.01 and Opera 6.05. But NS4.75 just crapped out (what else is new... who knows what caused it... screw it anyway). Interestingly, the <base> tag trick also worked for the all of the newer browsers I tried earlier... IE5/5.5/6, NS7.1, Moz1.2.1, Opera7.20... without having to specify the target in each menu item. In otherwords, if you only have one content frame, and if you use
Code:
<head>
  <base target="your_content_frame">
</head>

in your navigation frame's html file, then you can define your menu items' links without specifying the target in each item, like
Code:
aI("text=Menu Text;url=theUrlYouWant.htm";);

Saves having to type target=whatever; in each aI().

FWIW,

Kevin