PDA

View Full Version : HV Menu positioning and Mozilla scrollbars



nickgibbens
02-06-2007, 10:27 AM
1) Script Title: HV Menu v5.5

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm

3) Describe problem:

Regarding the HV Menu script.
I have a positioning problem with Mozilla 1.6:

I use a centered layout and menu
var MenuCentered='center';
var StartTop=80;
var StartLeft=-87;

Mozilla browser windows doesn't display a scrollbar when it isn't needed.

On shorter pages that doesn't have a scrollbar the menu is displayed ok.
When a longer page loads and the vertical scrollbar is displayed all the layout recenters in the window but the menu remains offset by the width of the scrollbar.

In IE this isn't a problem because the scrollbar is displayed as disabled even on pages that doesn't scroll.

I also tried with a relative positioned menu using TargetLoc='MenuPos' and the div tag as described in the docs, but the problem was the same.


How can I work around this ?

Thank you very much
Eddie

jscheuer1
02-06-2007, 10:54 AM
<style type="text/css">
html {
overflow-y:scroll;
}
</style>


That will make FF like IE.

nickgibbens
02-06-2007, 11:17 AM
I put the code above into the head of the page but it did not make any difference. Any suggestions.

Thanks Eddie

jscheuer1
02-06-2007, 11:33 AM
Try:


<style type="text/css">
body {
overflow-y:scroll;
}
</style>

But, here it did force FF to display an empty vertical scrollbar on short pages. Did you put it on the short pages?

nickgibbens
02-06-2007, 12:00 PM
Hi John

Yes the code is forcing FF to display an empty vertical scrollbar, even on short pages. However, the layout still recenters in the window but the menu remains offset by the width of the scrollbar. Thanks for all your help. What can I do?

Eddie

jscheuer1
02-06-2007, 12:05 PM
Might be something with the script or how you've configured it. How about a link to the pages? Preferably with the style change as noted.

nickgibbens
02-06-2007, 12:19 PM
Hi John

The link to the main page is http://www.syoa.co.uk/action4housing/index.htm

However, it does not have the <style type="text/css">body {overflow-y:scroll;}</style> tag becuase I'm at work and I don't have access to the page. I have been woking locally. However, the page above is forced by FF to display a scrollbar.

The javasctipt file which the menu uses is -
http://www.syoa.co.uk/action4housing/hvmenu/exmplmenu_var.js

if you can offer any help that would be great. The page looks how it should in IE.

Thanks

Nick

nickgibbens
02-06-2007, 12:21 PM
the Js file should be - http://www.syoa.co.uk/action4housing/hvmenu/exmplmenu_var.js

thanks Nick (Eddie is my nickname by the way)

nickgibbens
02-06-2007, 02:09 PM
I have now put that code into the page on http://www.syoa.co.uk/action4housing/index.htm

jscheuer1
02-06-2007, 03:24 PM
Try changing (in exmplmenu_var.js):


var StartLeft=0;

to:


var StartLeft=document.body.filters? 0 : -10;

nickgibbens
02-06-2007, 03:55 PM
John you're a star. I have got it to work in FF with a -9. Mozilla works on a -10 basis I think. Is is possible to set both a -9 and -10 in the var.

You have been a great help today. I really appreciate your help.

thanks

Nick

jscheuer1
02-06-2007, 04:14 PM
What do you mean? I thought FF was Mozilla. It is in fact but, there are also browsers based on the same general code that are specifically called Mozilla. However, this is a kludge that sets one standard for IE another for all others so, it cannot be fine tuned unless a way can be found to identify these other browsers. This is a dangerous road to go down as browsers change and then so must your code. It would be better to use no kludge but, a one browser kludge is easier to keep track of and isn't too bad. A one pixel difference should not be too much cause for concern in a niche browser like Mozilla, if that is what you really are talking about.

nickgibbens
02-06-2007, 04:48 PM
okay, thats cool. Mozilla is quite a niche browser type. thanks John.