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:28

Frameset menu item opens submenu,links new page,target=_top


Poster: Changer
Dated: Monday October 8 2007 - 23:31:32 BST

Hi, this question is regarding your menu accross framesets.

I would like to be able to have an item that opens a submenu and links to a new page. I actually don't want the new page to open in a new window, but would like it to open with a target=_top or target=_parent.

From your sample it said this could be done using a custom javascript as you can't call 2 targets in the aI() string. Can someone help me do this.

"An Item that Opens a Submenu and Links to a New Page in a New Window. OK... so you want it all. This can be done, but not within the scope of this system. To do this, you'd need to open the url in a new window using a custom javascript function that you'd call with the item's clickfunction property. Why? Because you cannot set two target properties in one aI() string. If you really want to do this, post a question in the Milonic v5.0 Help Forum and I'll help you."

Thank You.

Re: Frameset menu item opens submenu,links new page,target=_top


Poster: Ruth
Dated: Wednesday October 10 2007 - 4:23:03 BST

Hi,

Can you please give me the link to where you found that quote you posted. Once I have all the info I can perhaps help you.

Ruth

Re: Frameset menu item opens submenu,links new page,target=_top


Poster: Ruth
Dated: Wednesday October 10 2007 - 4:47:01 BST

Hi,

I actually found what I needed. What that means is that you need to create a function at the top of the data file in which the item you want to open in a new window and also have a submenu open is present. That function is to open the new window. Then in that item you would call the page and the new window by using clickfunction=yourfunction. So, as an example, in the menu_data_side.js file of the download I added this just after the top section where the open and close delay stuff is. You don't need all that stuff, I just put the size and position and such in to show it. The stuff from newwindow=window.open(url etc. must be on one line, it cannot wrap or the function won't work.

Code:
//newwindow function//
var newwindow;
function mynewwindow(url)
{
   newwindow=window.open(url,'name','height=500,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');

}


Then, [just to test it] I added this item to the menu itself right after the Side 4 + Link item, again this cannot wrap it must stay on one line.

Code:
aI("text=Side 4a + Link New Win;showmenu=sub4;clickfunction=mynewwindow('page4.htm');target=body;onfunction=openSubmenu();offfunction=closeSubmenu();");


This will show the submenu in the body page and will open thta page4.htm in a new window with the features listed. Note that not all options are available in all browsers. I think some won't position the page as to top and such.

Hope this helps.

Ruth