Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:32
Win XP style Menu
Poster: Rockerz
Dated: Wednesday April 23 2003 - 11:58:34 BST
Hi,
I'm working on a XP Style Menu and it looks perfect on my index page. But the links are to subfolders with html files in it and if I follow the link to the new html file in a subfolder the menu bg and menu images doesn't show up on the submenus and it has lost it's dimension. I only use a transparant bg on the main menu and it looks okay but the submenu ...?!
If I check the codes in the subfolder html file it points up to the top level so it should find the .js files. (I have the .js file in the root directory)
What's wrong? Can someone please help!!
One more question - is it best to have the .js script under the body tag or up under the head tag? I don't use frames and the menu is not inside a table. Right now I have it in the head part. Have tried to put it in the body tag as well but can't see any difference.
Thanks!
/Rockerz
Please help me with this!
Poster: Rockerz
Dated: Thursday April 24 2003 - 13:54:10 BST
I really need help with this, please someone!!!
If I put the submenues html files in my root folder the menu bg+icons on each page shows up and the menu works fine - but all the pictures on the rest of the page are missing.
I don't want to have all html files in the root folder, it will be a mess.
If I have the submenu html files in subfolders the menu dont work, well the main menu do but the submenues are gone/transparent and has lost it's size with only the linktext but the rest of the page works as it should.
I have tried to put the menu_array.js file in each subfolder but it doesn't help, I have changed the codes to point to the .js files but nothing helps.
What should I do to get it to work?
I can't fix this myself. Give me a hint .. give me your guess, whatever. I need help.
Rockerz
Poster: John
Dated: Thursday April 24 2003 - 16:14:22 BST
Have you set scriptpath in milonic_src.js? I have all my menu items in a sub-directory and it works fine with this item set.
Also, it would be better to post beta items in the Version 4 section to help keep the confusion level down
Poster: Rockerz
Dated: Thursday April 24 2003 - 16:47:00 BST
jgillett, thanks!
I didn't know it was a beta version and to post under another section, sorry!
I see that It works if I have the original menu_array.js file in the siteroot and make a copy of it and put it in in every subfolder (but changed the paths to the menu bg+icons in it).
I didn't know that I had to have the menu_array.js file in every folder and change it, I thought it would do to set the path to the js script file.
Rockerz
Poster: John
Dated: Thursday April 24 2003 - 17:07:19 BST
Quote:
I didn't know it was a beta version and to post under another section, sorry!
Not to worry. The V4 section is new.
Quote:
I see that It works if I have the original menu_array.js file in the siteroot and make a copy of it and put it in in every subfolder (but changed the paths to the menu bg+icons in it).
I didn't know that I had to have the menu_array.js file in every folder and change it, I thought it would do to set the path to the js script file.
I didn't know that I had to have the menu_array.js file in every folder and change it, I thought it would do to set the path to the js script file.
OK, now I'm confused. When you started talking about an XP Style menu I 'assumed' (bad thing to do, I know) you were working with the new V4 beta. However, under V4 there is no longer a menu_array.js file as such (unless you have chosen to rename one of the new files to that old V3 name).
So - what are we running here - V3 or the new V4 beta?
As to the calls, typically they go as the first thing in <body>. You do not need to have the array and/or menu file in every directory. Just call them from your pages.
Also, always post a URL. It really helps us to be able to see your code and the problem.
menu file locations
Poster: snapey
Dated: Thursday April 24 2003 - 19:49:47 BST
Rockerz
I'm not sure if we are talking at cross purposes here but....
It's quite acceptable to have the menu files in one location. The site I run has a single copy of the menu structure all stored in the _borders directory.
Just make sure that:
- the path on each page points to the absolute path of the menu files. That is to say in my case each page calls /_borders/mmenu.js etc - irrespective of which directory the page resides (note the backslash at the start of the path).
- the links to pages are all absolute also ie /index.htm, /section3/webpage.htm, /section3/subsection/another.htm
- that the path to the image files used on the menu is also specified as an absolute reference.
You have to remember that the menu is always executed within the current page and will look in the current folder unless you tell it otherwise. If you go into a subfolder then all links to other parts of the website have to either change or be absolute references.
In the examples above, if in the menu you specify that a "home" menu item links to "index.htm", then when you call the menu from a page in another folder then it will try to go to index.htm in the current directory.
The last thing you want to be doing is to have menu's in each subfolder because it would be a complete nightmare to manage.
On your other point. I had a lot of problems integrating the menu with Frontpage, and ended up including the menu in the head section of the page. It doesn't seem to be a problem but there is a strange effect in that the menu appears before the rest of the page!
Regards
Mark
Poster: Rockerz
Dated: Friday April 25 2003 - 13:53:47 BST
Thanks for your answers guys!
John - The version I use is; 3.5.12
Here's the url: http://w1.702.telia.com/~u70205862/
The only link that works is News-Joan Jett -Tour dates but here you can see what I mean. On index.htm the menu looks good but go to: http://w1.702.telia.com/~u70205862/Tour ... rdates.htm and you'll see that the menu doesn't work anymore.
I have checked the path and I know that I must have done something wrong somewhere but I can't solve it. Too bad! I have tried to move both .js files to the root directory and changed the path in the html file but that doesn't help either. The only solution I have found is to put a menu_array.js in each subdirectory and change the paths to the bg+icons - then I know it works.
This site is far from done now and I haven't cleaned up the code etc. For now I'm trying to fix the menu to see if it's a good to choice to have on the site. So far I think it is but I have to see that it works good first.
I bet you guys can find the error
Thanks!
Rockerz
Poster: snapey
Dated: Friday April 25 2003 - 14:49:03 BST
I will reply further when I have more time, but you need to understand relative and absolute paths to files.
You want one copy of the menu array - yes?
The menu has to work irrespective of the folder that the page resides in.
If you are in the root directory then src=menu/imagename.gif loads an image from /menu directory.
If you are in subdir1 then src=menu/imagename.gif tries to load an image from /subdir1/menu directory - and of course this is not the correct path.
You therefore need to specify the paths absolutely.
ie src=/~u70205862/menu/imagename.gif