The DynLayerInit() function can be used to initialize all your DynLayers at once automatically. The way it works is by retrieving all layers that contain an ID with a "Div" extension on it and defining DynLayers to only those particular layers.
To use the function just call it in your default init() function:
function init() { DynLayerInit() }
As long as you follow my lead of appending a "Div" to the names of your layers it will do the same thing as defining your layers manually. For example say you had a layer named "blueDiv" like this:
<STYLE TYPE="text/css"> #blueDiv {position:absolute; left:50; top:50;} </STYLE> <DIV ID="blueDiv"></DIV>
The DynLayerInit() function will automatically execute the code to initialize it:
blue = new DynLayer("blueDiv")
Notes:
View dynlayer-dynlayerinit1.html for an example.
Home | Next Lesson: Geometric Objects |