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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:44

Centering in explorer


Poster: yadin
Dated: Thursday March 7 2002 - 5:04:31 GMT

Centering in explorer doesn't work in a cross browser fashion.

When you center things in explorer it acts like there was a vertical scrollbar even if there ain't any.
This was done to prevent recentering in case dynamic content makes a scrollbar appear.

Problem is that our beloved menu centers itself CORRECTLY, without the "fake scrollbar" trick.

This makes a correctly centered menu in explorer fail to align on other browsers(in my case Mozilla).

To correct the behaviour(or to break it the MS way ;-) ) just go to line 495 of mmenu.js, character 363 and change

ww=_d.body.clientWidth;

into

ww=_d.body.clientWidth-15;


Cya!

Re: Centering in explorer


Poster: jj __at__ bitmaster.it
Dated: Wednesday April 10 2002 - 19:56:18 BST

Ahum... to fix NS 4.79(dunno about other releases)...

line 496, char 424

change:

ww=self.innerWidth-16

to:

ww=self.innerWidth-12


I'm not totally sure this is the way to go for fixing EVERY centering problem, but my menu wasn't going to cooperate any way but this.

I'm gonna test this with Opera and Konqueror, then I'll let you know if everything is working correctly.

Re: Centering in explorer


Poster: jj __at__ bitmaster.it
Dated: Wednesday April 10 2002 - 20:03:09 BST

Seems like I got it right... it works in Opera, too. :-)

Re: Centering in explorer


Poster: jj __at__ bitmaster.it
Dated: Wednesday April 10 2002 - 20:55:18 BST

Last rant for the day :-)

This is the ultimate fix for explorer... (it wasn't going to be ok anymore when scrollbars showed up):

line 496 char 341:

ww=_d.body.clientWidth;wh=_d.body.clientHeight

becomes

ww=_d.body.clientWidth;wh=_d.body.clientHeight;if( _d.body.clientHeight>_d.body.scrollHeight) ww=ww-15

Adaptive modification... hope I won't need to fix next versions, too ;-)))

Cya!