Forum Moderators: open

Message Too Old, No Replies

Menu Position Issue for different screens

         

hgerman

11:00 pm on Aug 24, 2007 (gmt 0)

10+ Year Member



I am building a website that is centered on the screen (similar to thomasville.com). I am using a dhtml menu from CofeeCup. I like this menu and don't want to use another one. The problem I'm having is that I have to define a location for it in the code, but as you can surmise, if it appears in the same place every time, everyone will see it differently depending on their resolution. At this time, I've saved the javascript code in a folder apart from the html and simply reference the menu in the html. Is there a way for me to use this type of menu so that it can scale with the user's screen resolution?

Marshall

11:43 am on Aug 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Without seeing your CSS or HTML, can you not set the size in percentages rather than pixels so it adjusts proportionately?

Marshall

hgerman

5:01 pm on Aug 27, 2007 (gmt 0)

10+ Year Member



I will give it a try. thanks

hgerman

8:49 pm on Aug 27, 2007 (gmt 0)

10+ Year Member



No go. I placed the code inside of a table. Below is the code that deals with menu position. I tried futsing with the table's properties but still can't get the thing to get positioned with that table. At least as far as i can see, the menu only respects the code below. Any ideas?:

var MenuTextCentered='left'; // Item text position 'left', 'center' or 'right'
var MenuCentered='left'; // Menu horizontal position 'left', 'center' or 'right'
var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static
var ChildOverlap=.2; // horizontal overlap child/ parent
var ChildVerticalOverlap=.2; // vertical overlap child/ parent
var StartTop=0; // Menu offset x coordinate
var StartLeft=0; // Menu offset y coordinate
var VerCorrect=6; // Multiple frames y correction
var HorCorrect=40; // Multiple frames x correction
var LeftPaddng=3; // Left padding
var TopPaddng=2; // Top padding
var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
var MenuFramesVertical=1; // Frames in cols or rows 1 or 0
var DissapearDelay=1000; // delay before menu folds in
var TakeOverBgColor=1; // Menu frame takes over background color subitem frame
var FirstLineFrame='navig'; // Frame where first level appears
var SecLineFrame='space'; // Frame where sub levels appear
var DocTargetFrame='space'; // Frame where target documents appear
var TargetLoc=''; // span id for relative positioning
var HideTop=0; // Hide first level when loading new document 1 or 0
var MenuWrap=1; // enables/ disables menu wrap 1 or 0
var RightToLeft=0; // enables/ disables right to left unfold

tedster

4:05 pm on Aug 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the page layout is centered, then the menu's position must be offset relative to that centered position, not offset from the left of the screen. I'd be suspicious of this line:

var MenuCentered='left'; // Menu horizontal position 'left', 'center' or 'right'

Since this is a complex and custom script, it's hard to say for sure. The HTML results are being created by a javascript function that you haven't pasted in, probably a document.write() of some kind.

hgerman

10:40 pm on Aug 29, 2007 (gmt 0)

10+ Year Member



I contacted the company and was told that I would have to create custom CSS code for both the menu and the page's html in order to make this work. Is this correct? If it is, how is this done?

tedster

5:18 am on Aug 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like you got the straight story. You've been using a proprietary script that generates the menu, now you'll need to write or customize at least some the DHTML by hand.

Could be a challenge if your coding skills are not up to it - and depending on the result you're looking for, it might take some serious chops -- especially for second and third level menus. My guess is that you can tweak what your script generates by paying attention to the css positioning as I laid out above.

hgerman

1:50 pm on Aug 30, 2007 (gmt 0)

10+ Year Member



I figured it out! Basically, I had to designate MenuCentered='center' and toggle the StartTop to a + value and the StartLeft to a - value. Pheew; thanks to all for your help!