Setting up the menu 5, after having converted from 3?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Setting up the menu 5, after having converted from 3?

Post by yanto75 »

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..?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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: Select all

<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>
It actually must be...

Code: Select all

<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>
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.
John
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

Hello, thanks for the correction... :) I still get an error though (in IE) where it complains about
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 :)
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

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 :)
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

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: Select all

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 !
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

yanto75 wrote:

Code: Select all

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 &nbsp;, Also, why do you have ;;; after the second one?
John
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

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 ";;;" :)
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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 &nbsp; 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 &nbsp;, 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'.
John
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

I did check that the &nbsp ; 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 &nbsp ; discussion or have a forum about this highly interesting topic ;)
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Think I better put my little bit in here ;)

As you know each menu item property is separated with a semi colon and as &ampnbsp;  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  &ampnbsp; 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.
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

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 :)
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

You can use 'margin', personally I don't like using it with horizontal separators, but its probably what you want.
Regards
maz
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

Hello Maz :) thanks for your reply.. I'll check it out immediately and see if I can make it work.. :)
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

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://milonic.com/forum/viewtopic. ... ght=margin

or I could insert a transparent gif or something..
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

My apologies for the ;;; confusion. Never said I knew it all... :oops:
John
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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 :idea: 's I've thrown at you help! ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
yanto75
Advanced
Advanced
Posts: 17
Joined: Sun Aug 17, 2003 10:48 am
Location: Sweden
Contact:

Post by yanto75 »

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.. :)
Post Reply