Milonic Javascript + CSS Layout Bug (?)

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
puddincat
Beginner
Beginner
Posts: 6
Joined: Tue Oct 21, 2003 7:05 pm

Milonic Javascript + CSS Layout Bug (?)

Post by puddincat »

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

Post by Maz »

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:

viewtopic.php?t=2931

Regards
maz
puddincat
Beginner
Beginner
Posts: 6
Joined: Tue Oct 21, 2003 7:05 pm

Post by puddincat »

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/documentatio ... /scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=http://www.law.widener.edu/documentatio ... /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
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Did you see the link I added?

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

-maz
puddincat
Beginner
Beginner
Posts: 6
Joined: Tue Oct 21, 2003 7:05 pm

Post by puddincat »

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.
:(
brettzamora
Advanced
Advanced
Posts: 26
Joined: Thu Oct 10, 2002 5:32 pm

Try adjusting _subOffsetTop...

Post by brettzamora »

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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

<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
puddincat
Beginner
Beginner
Posts: 6
Joined: Tue Oct 21, 2003 7:05 pm

Post by puddincat »

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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

Post by John »

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...
John
Post Reply