Click to See Complete Forum and Search --> : Position Javascript menu on website


dizzy
06-11-2003, 02:59 PM
I can position the javascript i have on my webpage using the pixels from top and left side. When the page is viewed in a different resolution it is of course out of the area it needs to be in. Is there a way i can use percentages to place my javascript? Is there another way that is simplier that i'm not thinking of that will solve this problem in other resolutions?

Thx dizzy

Khalid Ali
06-11-2003, 03:17 PM
One possible solution is to set left and to with %...
Second is to re-calculate when winow is resized.

khaki
06-11-2003, 03:38 PM
hi diz...

someone out there has some crazy math code that takes the avaiable screen area, subtracts the width (and/or height) of your menu, divides it by 2 (i think) and then recalculates it onResize
(unfortunately.... that "someone" is not me :rolleyes: )

but I believe that I saw it solved that way. Hopefully the person with that code is lurking about.

I don't beleive that you will have much success using percentages though.
The width and height of your menu will skew the calculation (i think).

I'm going to follow this thread and SAVE the solution (for the next time this question pops-up) :)

;) k

EDIT: maybe that "someone" was Dave Clark :confused:
well... if so... he is definitely lurking-about sooner or later... so we'll find-out soon enough ;)