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:17
Setting up the menu 5, after having converted from 3?
Poster: yanto75
Dated: Friday August 22 2003 - 21:03:01 BST
I can't see anyone having had problem setting up the menu, so it must be kind of obvious..?
I upgraded from menu 3 to 5. When I used menu 3, my HTML file had these lines:
<SCRIPT language="JavaScript" src="/Index/js/menu_array.js" type="text/javascript"></SCRIPT>
<SCRIPT language="JavaScript" src="/Index/js/mmenu.js" type="text/javascript"></SCRIPT>
so, now after the upgrade to 5, what do I need to do..? My assumption was to just change the names:
<SCRIPT language="JavaScript" src="/Index/js/menu_data.js" type="text/javascript"></SCRIPT>
<SCRIPT language="JavaScript" src="/Index/js/milonic_src.js" type="text/javascript"></SCRIPT>
and that milonic_src.js contains references to the two other files, hence making it necessary to only include that file? (I've placed all .js files in the same folder).
Do I need to add something else to the HTML files to make it work, or modify the .js files first prior to being able to use them..?
Poster: John
Dated: Friday August 22 2003 - 21:24:45 BST
Most of what you have said is correct, with one or two small (but very important) exceptions. You need to reverse the order of the calls to the new menu. You have posted...
Code:
<SCRIPT language="JavaScript" src="/Index/js/menu_data.js" type="text/javascript"></SCRIPT>
<SCRIPT language="JavaScript" src="/Index/js/milonic_src.js" type="text/javascript"></SCRIPT>
<SCRIPT language="JavaScript" src="/Index/js/milonic_src.js" type="text/javascript"></SCRIPT>
It actually must be...
Code:
<SCRIPT language="JavaScript" src="/Index/js/milonic_src.js" type="text/javascript"></SCRIPT>
<SCRIPT language="JavaScript" src="/Index/js/menu_data.js" type="text/javascript"></SCRIPT>
<SCRIPT language="JavaScript" src="/Index/js/menu_data.js" type="text/javascript"></SCRIPT>
milonic_src.js must be called first, as it does the calling of the other menu code.
Also, there is no need to change any file names. milonic_src.js is brand new to v5, and not the same as mmenu.js in v3.
Poster: yanto75
Dated: Friday August 22 2003 - 22:07:55 BST
Hello, thanks for the correction... I still get an error though (in IE) where it complains about
Quote:
Error: Object expected
but right now I'm out of ideas... (I only have one long line for the entire .js file ) will try again tomorrow.. thanks for the help
Poster: John
Dated: Friday August 22 2003 - 22:12:03 BST
Not sure what you mean by "...one long line...". The calls should be as I posted them above.
Give us a URL so we can see your error and code.
Poster: Hergio
Dated: Friday August 22 2003 - 23:30:32 BST
Do a search for scriptpath in the v5 Forum and you will find your answer. Inside milonic_src there is a variable called scriptpath that will point to the directory where your other files are stored, its important and you get an object expected error when its not referenced right since your menu_data file is trying to call on functions it cant find.
Poster: yanto75
Dated: Saturday August 23 2003 - 9:11:20 BST
Yeah, when I set the scriptpath, it worked better.. for some stupid reason I got it in my head that I only had to modify scriptpath if the other .js files were located in a different directory other than the menu_data.js file..
Now I have solved most of the cosmetic errors I got (with color, positioning and padding etc) but I can't find the property to apply opacity/transparency to the menus (I liked that feature a lot !! I can't find how to make the "shadow" work as well, although I've set the
high3dcolor and low3dcolor
Maybe there's some effects=1 or something that must be turned on to make transparency and shadow features work?
(jgillet: "by one long line" I meant that the source code inside the milonic_src.js files is just in one long line, instead of being lined up line by line.. I read that it was due to a UNIX/Win problem, and that it could be solved by checking the file in Wordpad or Ultraedit instead of Notepad, but it didn't work for me.. so looking for possible errors when it looked like that was a bit more difficult.. but on the other hand, I guess the only file that needs modification is menu_data.js)
thanks for your fast responses again
Poster: Hergio
Dated: Saturday August 23 2003 - 16:38:47 BST
Do a search in the v5 forum for overfilter and outfilter, you will find plenty of code examples of how to do it. ANd the reason is its one line is because the javascript compressor squeezes out all the whitespace in the file to reduce filesize, and this includes linebreaks. The file is smaller because of it, but tough to read...but hey, it downloads fast.
Poster: yanto75
Dated: Saturday August 23 2003 - 18:09:37 BST
Hello Hergio ! Once again, that worked.. many thanks ! hmm.. well, I have two more questions (these will be last "design/graphics" questions)
I wonder how to make a bit of padding on the left/right side of menu items...? I found a property that, indeed, was called "padding" and I tried it and set padding=15, but all it did was to increase padding to from top to bottom, not left right.. is there another property maybe?
And then I wonder.. hmm.. how to describe.. well, like this, I have a top image, that is, I don't know.. 800px wide. I would like the menu to be as long as the my top image is, since it's located just beneath it. Is there a property for that..? Right now I'm solving it by making field with many & n b s p; like this:
Code:
aI("text=& n b s p; & n b s p ;;;status=Online notes;separatorsize=1")
but that field changes color on mouseover and it doesn't get just perfect.. feels like amateur approach is there another way..?
many thanks again !
Poster: John
Dated: Sunday August 24 2003 - 0:47:05 BST
yanto75 wrote:
Code:
aI("text=& n b s p; & n b s p ;;;status=Online notes;separatorsize=1")
With those spaces in the & n b s p it will not be read as a non-breaking space. Needs to be , Also, why do you have ;;; after the second one?
Poster: yanto75
Dated: Sunday August 24 2003 - 7:07:17 BST
Hi jgillett.. well, hehe... when I first wrote without spaces, it was actually converted to a blank space, so then I figured I should try to write it so that it would be visible by adding space between each.. (hm, but now I can write without spaces so maybe I was just unlucky the first time).
the ;;; is because has one ";" and then there were two ";;" after.. so all in all, there were ";;;"
Poster: John
Dated: Sunday August 24 2003 - 7:42:58 BST
yanto75 wrote:
Hi jgillett.. well, hehe... when I first wrote without spaces, it was actually converted to a blank space, so then I figured I should try to write it so that it would be visible by adding space between each.. (hm, but now I can write without spaces so maybe I was just unlucky the first time).
Actually no, you can't. It's usually wise to check your posts to make sure what you're trying to say is really there, especially when posting code we're supposed to debug. That's why the Preview button is there.
Had you used that button, or even looked at your post after Submit, you would have seen a (blank space), rather than the you were trying to write. Try checking Disable HTML in this post.
yanto75 wrote:
the ;;; is because has one ";" and then there were two ";;" after.. so all in all, there were ";;;"
I'll give you one ; for the , but not the other two. No idea where you got that from, but you only use a ; if there is an associated parameter to go with it - no 'empties'.
Poster: yanto75
Dated: Sunday August 24 2003 - 18:29:41 BST
I did check that the   ; was visible.. actually I went in an changed it after I posted and saw that it was okay, and then changed again... and checked the preview.. but now when I got home I saw that it's not there..
maybe we can write a book about   ; discussion or have a forum about this highly interesting topic
Poster: Andy
Dated: Sunday August 24 2003 - 19:04:35 BST
Think I better put my little bit in here
As you know each menu item property is separated with a semi colon and as &nbsp; and all other html entities end in semi colon it used to cause problems. The version you are using might have included a bug that would chop the property up at the first ;
However, the latest version is smart enough to know that &nbsp; is not the end of the property and should add it as text to each of the properties.
Also, it shouldn't matter how many ;;;'s there are. As each one is classed as a property it should still cycle through all of them extracting relevant information until it reaches the end of the text string. If one is empty, then no problem, it should just carry on to the next.
Hope this helps
Regards
Andy.
Poster: yanto75
Dated: Sunday August 24 2003 - 20:29:24 BST
Hello Andy Okay, I'm glad to hear it didn't matter.. was thinking whether or not to start to remove those ; Hmm.. so I was wondering if there was a property to insert padding to the left and right of the menu item, but without at the same time adding padding on the top/bottom..? If there isn't, it's quite alright, cause it's just a minor detail.. again, many thanks for this superb menu.. Makes the website look 100 times better
Poster: Maz
Dated: Sunday August 24 2003 - 21:11:26 BST
You can use 'margin', personally I don't like using it with horizontal separators, but its probably what you want.
Regards
maz
Poster: yanto75
Dated: Sunday August 24 2003 - 21:30:57 BST
Hello Maz thanks for your reply.. I'll check it out immediately and see if I can make it work..
Poster: yanto75
Dated: Sunday August 24 2003 - 22:17:55 BST
Hmm... maybe it should work.. but nothing happens when I try it.. I also tried the keepalive property but it didn't respond either.. I'll try again tomorrow (getting late here.. maybe it's just something simple that needs changing
I did however find a good post (a workaround) which I guess I could try:
http://www.milonic.com/forum/viewtopic.php?t=2240&highlight=margin
or I could insert a transparent gif or something..
Poster: John
Dated: Monday August 25 2003 - 15:22:02 BST
My apologies for the ;;; confusion. Never said I knew it all...
Poster: Hergio
Dated: Monday August 25 2003 - 16:24:56 BST
TO put padding on either side of the menu, the non-breaking spaces or a transparent image are good choices. I use the spaces sometimes. But you can also try itemwidth. This property can be set in the menu declaration itself, OR in the aI of each item. The menu will then take the width of the longest itemwidth defined (or the longest string) in the menu. This will give you a menu with all the items to the left, with as much space to the right as you want. If you want them centered, then set the align centered and you will have your items centered with space on both sides. The itemwidth property can be "??px" or "XX%", but % can be unpredictable. Give this a try, hope it works. If you need an example, let me know, I'll post one if you don't quite get what I'm saying.
To make your menu stretch the whole 800px, you could do two things. First, set the Itemwidth in each menu item. So if you had 8 top level menu items, make them each 100px, and viola, you have a 800px menu. The other option is to tag an extra menu item (aI) onto to menu. Set its text to one nonbreaking space, no URL, and set its itemwidth to exactly what you need to make it reach. Or 100% to make it go almost to the edge of your screen. It would be a good idea also to create a new style with your on/off background and border colors the same so when you hover over it, you see no changes (so it doesnt look like a menu item). Hope these 's I've thrown at you help!
Poster: yanto75
Dated: Monday August 25 2003 - 16:52:37 BST
Hello Hergio ! Super, you seem to know a LOT I much obliged.. as soon as I get home I will try what you said.. I will aslo try Maz' suggestion again.. maybe it will work better today..
Poster: Hergio
Dated: Monday August 25 2003 - 18:10:48 BST
yanto75 was kind enough to have wrote:
Super, you seem to know a LOT
The key word here is 'seem'. I only seem to know alot...hehe. But seriously, I just like to know things as well as I can. And if I can help others with something I've figured out, I say hey why not? Glad I could help!