[thelist] inserting value into JS array

Liorean Liorean at user.bip.net
Fri Feb 1 13:48:01 CST 2002


At 13:29 2002-02-01 -0500, aardvark wrote:
>if (IsMac() == true) {
>         topOffset = 0
>}
>else    {
>         topOffset = 15
>}
>
>but how do i insert 'topOffset' into an array like this (some of you
>should recognize this) and get it to accept it?  it's not offsetting the
>DHTML menu for Mac users, but it's not throwing an error (and i did
>test the Mac test and the number assignment)...
>HM_Array2 = [
>[100,           // menu width
>130,            // left_position
>topOffset,                      // top_position
>"#000000",      // font_color
>"#ffffff",   // mouseover_font_color
>// "#6699CC",   // background_color
>"#999999",   // background_color
>"#336699",    // mouseover_background_color
>"#000000",     // border_color
>"#000000",    // separator_color
>1,                      // top_is_permanent
>1,          // top_is_horizontal
>0,          // tree_is_horizontal
>1,          // position_under
>0,          // top_more_images_visible
>1,          // tree_more_images_visible
>"null",     // evaluate_upon_tree_show
>"null",     // evaluate_upon_tree_hide
>],          //right-to-left
>["Departments","/document_391.html",1,0,1],
>......snip......
>]
>
>(i can hear you all laughing at my JS 5k1llz)
Not at all.

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.

// Liorean




More information about the thelist mailing list