DynLayerInit() Function

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. This function does not apply to layers inside IFrames, you have to apply those manually.

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.

The Dynamic Layer Object API

Extending the DynLayer

Home Next Lesson: Geometric Objects
copyright 1998 Dan Steinman