Unwanted Horizontal Scrollbars

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
spirollo
Beginner
Beginner
Posts: 7
Joined: Wed Aug 27, 2003 6:21 pm
Location: Bucks County, PA

Unwanted Horizontal Scrollbars

Post by spirollo »

I am putting new menus together in v5.0 I used the overflow="scroll" command so menus longer than the browser window will have a vertical scrollbar.

The problem is that whenever I have a vertical scrollbar appear, I also have a horizontal scrollbar appear on the menu as well. This occurs even though there is plenty of room for the width of the menu.

Any insight would be appreciated.
Scott
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Please post a URL so we can see the error and your code.
John
spirollo
Beginner
Beginner
Posts: 7
Joined: Wed Aug 27, 2003 6:21 pm
Location: Bucks County, PA

Post by spirollo »

Sorry, that would help.

Here is the link. Make the window stretch the entire screen, but make height very short. Check out the menu Teams/MLB/American League for instance.

http://209.210.237.14:8080/spbaseball/o ... ile=notify
Scott
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Don't understand the problem, but note I got script error on member menu submenu line 193 char 295 Invalid procedure call or argument.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Its because the menu renders to the width of the longest string within it...which is fine. But then there are too many items to fit, so it must put in a scroll bar, and uh-oh, now we dont have room anymore with regard to the width, gotta throw in another scroll bar. To fix this, explicitly increase the width of the menu so that when the scroll bar appears, the menu is still wide enough to accomedate it. In your menu declaration, you can set an itemwidth property to something like, "120px". Look in the menuproperties reference if you dont understand.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
spirollo
Beginner
Beginner
Posts: 7
Joined: Wed Aug 27, 2003 6:21 pm
Location: Bucks County, PA

Post by spirollo »

I understand what you are saying about it not taking into account the vertical scrollbar into the width - thus causing the need for the horizontal. I thought that was the case myself. But if that is the case, I would think that the sample menus the provide would have the same problem as I don't see where they are explicitly setting the width to make them work. So I think there is some other problem. For instance, check out the sample menu in the URL below. Note that the "Menu Samples" submenu has a veritcal scroll bar, but no horizontal one. And I see no where in the setup where it set the width explicitly.

http://milonic.com/menusample.php?sampleid=1

Thanks for your responses.
Scott
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

He has his padding setting set to 5, yours is 2....try that. Play with it, I dont know for sure, I am giving you ideas. Also did you try the itemwidth?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
spirollo
Beginner
Beginner
Posts: 7
Joined: Wed Aug 27, 2003 6:21 pm
Location: Bucks County, PA

Post by spirollo »

Good ideas. I tried both of them, but still no dice...
Scott
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Why do you have the scriptpath variable in the middle of your HTML? It belongs in milonic_src.
John
spirollo
Beginner
Beginner
Posts: 7
Joined: Wed Aug 27, 2003 6:21 pm
Location: Bucks County, PA

Post by spirollo »

Regarding the scriptpath, it is there because it is a dynamic path. For ease at the moment I put it in there so my velocity macros can process the path and set it. I will eventually include the milonic_src.js as a velocity macro as well but haven't gotten that far yet.

Regarding my reported problem, I seem to have found the culprit. When you have a menu in an html body that has the CSS attribute "overflow-y" set to "hidden". It causes the horizontal scroll bars to appear, regardless if there is room on the width of the page or not. If that is changed to something other than hidden, it works like a champ.

I have reported this bug to Andy for his consideration.

I'd like to thank you all for your responses and help.
Scott
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Nice job spirollo, good detective work. :D :!:
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Glad you got it, spirollo. I suspect Dave and I would have still been working on that one...
John
Post Reply