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

openmenusbuurl.js - Pages in Subfolders

Poster: r3tr0x
Dated: Thursday January 12 2006 - 12:55:43 GMT

Hey guys

I'm on the verge of purchasing the full version of the menu but am still experiencing a few minor issues with my site. Heres the main one atm:

I have an index.php to which all my pages are passed into (i.e. index.php?page=contact). Now the openmenusbyurl scripts works great if the page am i am trying to load is in the same folder as my index.php (such as the contact page mentioned above). If I navigate to index.php?page=contact/details however (which is a php file called details.php inside a subfolder called contact), the script fails. The page loads correctly so I know the page is there and the link to it is functioning, but the script can't seem to see whats happening.

Is there anyway to get this to work as required. If not then I'll have no choice but to move all of my files currently located in subfolders into my root folder - which isn't desirable as there are quite a few.

I've got a demo up here:

The Home and Contact links work (including the contact submenu) but the others do not.

Thank you for your time, any help greatly appreciated

Kind Regards


Poster: Andy
Dated: Thursday January 12 2006 - 13:03:08 GMT


Try replacing the following HTML:

<SCRIPT type="text/javascript" src="includes/milonic_src.js"></SCRIPT>
<script type="text/javascript" src="includes/openmenusbyurl.js"></script>
<param copyright="JavaScript Menu by Milonic"></param>
<script type="text/javascript">
if(ns4)_d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=includes/mmenuns4.js><\/SCR"+"IPT>");
else _d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=includes/mmenudom.js><\/SCR"+"IPT>");

With this:

<script type="text/javascript" src="/includes/milonic_src.js"></SCRIPT>
<script type="text/javascript" src="/includes/openmenusbyurl.js"></script>
<noscript><a href="">JavaScript Menu, DHML Menu Powered By Milonic</a></noscript>
<script type="text/javascript">
if(ns4)_d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=/includes/mmenuns4.js><\/SCR"+"IPT>");
else _d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=/includes/mmenudom.js><\/SCR"+"IPT>");

Hope this helps,

Poster: r3tr0x
Dated: Thursday January 12 2006 - 14:41:59 GMT

Hi Andy

Thanks for the quick response.

Unfortunately changing the above code results in the menu not loading at all. As you can see on nothing appears where the menus should be. Sorry to be a pain...

Kind Regards


EDIT: I've removed the '/' from the paths to get the menu working again so I can continue customising it.

Poster: r3tr0x
Dated: Thursday January 12 2006 - 20:08:26 GMT

Ok i think im almost done with the customising of my menu. Still not sure why the openmenusbyurl script wont work if the pages are in subfolders. As soon as I move them to my root folder it works ok.

I've also got another issue im sure someone could help me with. I've read a few threads about forcing the rollover state of an image when on a page in that menu, although I can't get it working:

If you rollover either links or contact, the rollover state remains whilst hovering the mouse in that submenu, although wen u click and the page loads this is lost. The openmenusbyurl script works for these 2 links (my submenu item is highlighted grey) but the rollover state for the main menu image is lost. I've tried using pageimage=imagepath on my submenus, is this what I should be using or is there another parameter I have missed.

Sorry for all the questions.

Thanks in advance, Mark

Poster: embee15
Dated: Monday January 23 2006 - 9:12:44 GMT


I have just the same problem with the submenus.

As soon as the page that I open is in the same folder, everything's fine.

If it's in another folder - no menu opens.

I tried to copy the openmenusbyurl.js in every folder or refer to the same openmenusbyurl.js in the file by using

<script type="text/javascript" src="../main/openmenusbyurl.js"></script>

Poster: Ruth
Dated: Monday January 23 2006 - 13:31:02 GMT

Hi Mark,

About the rollover state:

1st, in the main menu you have images, you are coding it as image=home_btn_up.gif, this is the state of the menu when the mouse is not on it, then you have overimage=home_btn_over.gif, this is when you mouseover and it is the darker bluish image. But, for your page matching you are using a bgimage, that won't show as the image since it is a background image and you have an image sitting over the top of it.

2nd, I'm not a php person so I don't know why you have the active page coding set into the menus rather than into the style or the item. As far as I know that is not a menu property, it is either style or item property, and the one you want to show the match is the main menu, so you'd code the active page coding into the item in the main menu. This means you'd code each main menu item with its own pageimage since you are using images with text on them.

So, in the main menu, assuming you want the darker bluish colored image to show it would be, for example:

Sorry I can't help on the openmenusbyurl problem. Have you tried putting in the full path to the openmenusbyurl.js module on all the pages?


Poster: embee15
Dated: Monday January 23 2006 - 14:20:11 GMT

About the paths:

Yes, I tried relative paths, absolute paths - everything.

Has anyone ever managed that function with different subfolders?

Poster: Ruth
Dated: Monday January 23 2006 - 14:43:34 GMT


Yes, the Openmenusbyurl Demo works fine. The first 3 items are all in the same main folder, the fourth item the pages are in a subfolder.


Poster: embee15
Dated: Monday January 23 2006 - 15:04:56 GMT


I saw that the demo version is using the http://... paths, I tried that and it works!

Now one more (last, I promise :-) ) question: Where do I have to change anything so the "pre-opened" menu is closed OnMouseOut, that means as soon as the mouse is leaving the menu area?

If I move the mouse away from the menu now, the menu is closed for a short time, then it opens again. Is there a way to switch off that re-opening?

Poster: Ruth
Dated: Monday January 23 2006 - 15:15:43 GMT

Sorry, that's not going to be possible. The openmenusbyurl reads the url and says 'ok, we are there so open the corresponding menu'. You could try using keepalive=1; in the menus and it should keep it from closing when you mouseover and off that menu, stopping the close/open action. I haven't experimented with that. I know there's an item property for opendelay but I can't find one for closedelay so I don't think it's possible to set the close delay for each individual menu, again just another way to keep it from closing when you mouseOff the already opened menu.

Other than that, unless there's some function someone could write to disable the openmenusbyurl once a submenu that is opened by it is moused then I can't think of anything else to try.


Poster: r3tr0x
Dated: Wednesday February 1 2006 - 13:12:14 GMT

Hey guys

Sorry for the delay in replying - been a bit busy.

Thanks for all the suggestions - they worked a treat! I have purchased the menu and have it working just how I want it.

I do have one or two minor queries but they are nothing urgent so have posted these in separate threads (to help with searches etc).

Thanks again for all the help!