PDA

View Full Version : Putting Together vars depending on resolution



hnpdyn
06-12-2006, 10:29 PM
Please help me.
This is the oreginal.

var lv_ch=new Array() //LV Center Header
if (screen.height==480) lv_ch='15';
else if (screen.height==600) lv_ch='17';
else if (screen.height==768) lv_ch='19';
else lv_ch='28';
var ft_wd=new Array() //LV FoldSub Width
if (screen.height==480) ft_wd[0]='136';
else if (screen.height==600) ft_wd[0]='142';
else if (screen.height==768) ft_wd[0]='150';
else ft_wd[0]='200';

How I wanted!
I want to put them together.
(Example below but it doesn't work)

var lv_ch=new Array() //LV Center Header
var ft_wd=new Array() //LV FoldSub Width
if (screen.height==480)
lv_ch='15'; ft_wd[0]='136';
else if (screen.height==600)
lv_ch='17'; ft_wd[0]='142';
else if (screen.height==768)
lv_ch='19'; ft_wd[0]='150';
else
lv_ch='28'; ft_wd[0]='200';

I guest there's a way to do something like this, but I can't do it. If you can, please help me.

Thank You

Twey
06-13-2006, 01:09 PM
Don't do it.

You can't possibly anticipate every possible resolution, so don't try. A well-designed (relatively-sized) page will adjust itself to any resolution automatically. There should be no need for this.

hnpdyn
06-13-2006, 02:58 PM
I want to do it because I want different width & font-size on a differnet resolution. (I don't want the visitor with higher resolution setting see my menu to small.) That's the reason why I want it.

Thank You!

Twey
06-13-2006, 03:08 PM
A well-designed (relatively-sized) page will adjust itself to any resolution automatically.This includes font sizes. I have nothing more to say on the matter.