Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Horizontally Centering an Array on Different Screens

Status
Not open for further replies.

xyzuser

Technical User
Aug 13, 2008
96
US
Inexperienced user question:

I have a JavaScript array (downloaded, not my own)) that displays a dropdown menu and specifies style=position: absolute; I've changed the top to where I want the menu to be vertically but it has a complex series of formulae (with meaningless variable names) to set the left position and the width .

The menu displays fine on some screens that have less resolution (800x600) or smaller browser windows but are completely to the left and not centered on other screens.

What would I have to do to make this displayed menu be horizontally centered in every browser window? (I realize the answer may require more experience than I have to write and implement and I may have to accept that it won't look right on many browser windows.)

 
I honestly think you're barking up the wrong tree by ignoring the advice given on your identical post in the HTML forum.

I think you'd be far, far better off by using HTML to position a nicely-written menu, not using JS to hack one that (a) you don't understand, and (b) has some mystical positioning rules that you need to apply depending on your users' browser width and/or screen resolution.

Honestly - you should never need to have write these crazy rules depending on browser width / resolution - it's just too much like hard work to maintain and get looking good for everyone.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top