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

Milonic Javascript + CSS Layout Bug (?)


Poster: puddincat
Dated: Thursday October 23 2003 - 17:04:03 BST

hi
i have a template page ( and a bit o' heartburn :( over this)

http://www.law.widener.edu/documentatio ... ener.shtml

in which
this part of the Milonic code:
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=js/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=js/mmenudom.js><\/scr"+"ipt>");
</script>

seems to be pushing my page contents UP by 10px.

here is the url to my js
http://www.law.widener.edu/documentatio ... nu_data.js

url to my css:
http://www.law.widener.edu/documentatio ... idener.css

any workarounds?
i have tucked the js right below the body, right inside the head, i have changed it to this in hopes that would get rid of the 10px:

<script type="text/javaScript">
_d.write("<scr"+"ipt language=JavaScript
src=js/mmenudom.js><\/scr"+"ipt>");
</script>

but, nothing
any ideas out there?
:(
cass


Poster: Maz
Dated: Thursday October 23 2003 - 18:45:43 BST

Just and idea. Since I've been learning about font sizes, and verdana is so variable, does it make any difference between using 75% & 80%?

Also see this thread:

http://www.milonic.com/forum/viewtopic.php?t=2931

Regards
maz


Poster: puddincat
Dated: Thursday October 23 2003 - 19:18:06 BST

hi maz
font size isnt the issue
ive really narrowed it down to the code
here:
<script language=JavaScript>
_d.write("<scr"+"ipt language=JavaScript src=http://www.law.widener.edu/documentation/production/js/mmenuns4.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=http://www.law.widener.edu/documentation/production/js/mmenudom.js><\/scr"+"ipt>");
</script>

ive even left the milonic js and removed all other js to see if there was a compatibility prob. but,no...layout is fine unitl i pop those few lines in there
any workarounds?
cass


Poster: Maz
Dated: Thursday October 23 2003 - 20:03:30 BST

Did you see the link I added?

(or) Anyone know if this sounds like a bug for Andy?

-maz


Poster: puddincat
Dated: Thursday October 23 2003 - 20:31:28 BST

hi maz
forgive me, what link should i be looking at?
not sure

thanks for letting andy know about this
:)
cass
ps
i am SO dead here at work. deadline not gonna happen. gulp.
:(

Try adjusting _subOffsetTop...


Poster: brettzamora
Dated: Thursday October 23 2003 - 20:54:21 BST

I just experienced a very minor alignment issue after implementing the V5RC17 menu. I had to adjust the _subOffsetTop variable to -3 to overcome the issue. You might experiment with those variables and see what you come up with.

Also I had some issues with the way that particular script block was put together. Which I worked around and posted my changes on the forum today.

Regards,

Brett


Poster: kevin3442
Dated: Thursday October 23 2003 - 22:51:05 BST

Hi Cass,

A couple of comments that might help:

It seems that the rendering of the menu is screwing up the margin setting for #pageFrame in your .css -- don't have a clue as to why. Oddly, it affects only the top margin and not the others. I tried setting the margins individually (both margin: 10px 10px 10px 10px; and margin-top: 10px; margin-left: 10px; etc.) in #pageFrame, but it didn't work. As a bandaid, I added margin-top: 10px to the body{} style definitions at the top of widener.css, and that worked. A kludge perhaps, but it works.

If you don't mind my saying, I think you're going to run into other problems in the way you've tried to implement the menu. Using an image map for the main menu, with part of the descender of the 'f' in 'of' appearing in the image, will probably be a cross-browser alignment nightmare. In addition, your image map implementation does not use the popup() function correctly. You'll see that in some (probaqbly most) browsers, the submenus are progressively offset further and further to the right as you traverse the main menu from left to right (e.g., try it in ie6/windows). I think you'd have far better luck making your main menu an actual Milonic menu, the way most horizontal main menus are implemented. You could do this and still have the menu look the way you want it to (i.e., like your nav_bluestripe.jpg), and position it where you like, within the part of the header you've obviously reserved for it. Not only that, but the menu would probably load a little faster and be easier to modify/maintain. Think about that, and we'll see if we need to continue this thread on that topic.

Also, the way you're currently loading the three menu scripts (milonic_src.js, mmenudom.js, and mmenuns4.js) is not the prescribed method. You've taken out the if/else that differentiates between ns4 and dom browsers. If you do that, you'll be loading both mmenuns4.js and mmenudom.js, which will almost certainly lead to other problems. You should revert back to:
Code:
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script   language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");      
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>

Regarding Brett's comment, what he did (removing the concatenation of the "script" string) will work, but if I recall correctly, Andy did that so that the menu script can get past some personal firewall software (Symantec?). I'd recommend sticking with the prescribed approach unless forced to do otherwise.

Hope that helps,

Kevin


Poster: puddincat
Dated: Thursday October 23 2003 - 23:51:30 BST

kevin
wow! that's a lot to digest.
thank you so much. ill go thru and implement your suggestions.
thanks for taking the time to look with such care at my page
:)
cass


Poster: kevin3442
Dated: Friday October 24 2003 - 1:58:52 BST

Hi Cass,

It will actually be easier than it sounds to implement your main menu as an actual menu. The core of your menu system is already there, since all of your submenus are already defined. All you have to worry about is making the main menu, then sizing and placing it to fit in the space you've alotted. If you need help, just holler!

Kevin


Poster: John
Dated: Friday October 24 2003 - 2:19:39 BST

Kevin is absolutely correct about fixing those JS calls (you don't want to know what it's doing in Safari right now!).

Also, you're running RC17, but a few levels down from the latest RC17 release. You might want to get that updated.

Here's another thought... take the light blue bar at the bottom of the graphic (including the 'f') and cut it away from the whole graphic. Place your menu titles on the bar (as graphic text) and then chop it up into 7 menu-size pieces. That's your main menu, and the pieces are placed, not generated, by Milonic. Now all you do is call your subs.

See http://westcgi.west.asu.edu/sai/ for an example of this. I have left a 1px space around mine, but that can obviously be adjusted.

Kevin, you still owe me a reply to a previous off-line question...