[thelist] inserting value into JS array

aardvark roselli at earthlink.net
Fri Feb 1 15:21:01 CST 2002


> From: Liorean <Liorean at user.bip.net>
[...]
> >(i can hear you all laughing at my JS 5k1llz)
> Not at all.

well, you should be...

> HM_Array2=[...,IsMac()?0:'15px',...]; // This should work, but I don't
> know exactly since you didn't tell us how you use it. Always add 'px'
> directly after any non-zero space.

none of the other numbers in the array have px in them...

the DHTML menu (you can see one in play at
http://quantumcms.com/document_58.html, cuz the one i'm
working on is an intranet) sits too low on Macs... i need it to only
sit 0px offset from the top for Macs, and 15px for PCs...

the array starts off as:
HM_Array2 = [
[100,		// menu width
130,		// left_position
15,			// top_position
"#000000",      // font_color

but i want to replace that 15 with a different number depending on
platform, thereby adjusting its offset from the top of the window...

and taking the scipt you provided, i made it a function, and then
call that in an if statement above all this array stuff:
if (IsMac() == true) {
	topOffset = "0px"
}
else	{
	topOffset = "15px"
}

so, i'm stuck...




More information about the thelist mailing list