Have Javascript create the layers?
I made a bunch of arrays with information (such as layerName, xPosition, yPosition, content for each layer etc etc) and now I want Javascript to create the layers using the information from the arrays. How do I go about doing this?
The trouble with doing something right the first time is that nobody appreciates how difficult it was.
Mark Hensler posted this at 07:15 — 18th April 2001.
He has: 4,048 posts
Joined: Aug 2000
where are you stuck?
Rageforth posted this at 13:06 — 18th April 2001.
They have: 56 posts
Joined: Feb 2000
Basically I am stuck at the beginning. All I have is my arrays set up that have the layer name, the links, the position of each layer, etc., but I do not know how to begin to tell Javascript to create a layer using these arrays.
The trouble with doing something right the first time is that nobody appreciates how difficult it was.
Mark Hensler posted this at 17:39 — 18th April 2001.
He has: 4,048 posts
Joined: Aug 2000
How are your arrays built? are they in numeric order?
You can use a FOR LOOP to cycle through the arrays, and print the layer HTML to the page.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.