Core DynLayer Methods

The core methods (moveTo(), moveBy(), show(), and hide()) are by default included in the DynLayer. They are always available because they are used quite often.

The moveTo() Method:

The moveTo() method moves the layer to a specific coordinate:

objectName.moveTo(x,y)

If you need to only change one of x or y why you can send null for the value:

objectName.moveTo(x,null)
or
objectName.moveTo(null,y)

Examples:

mylayer.moveTo(100,50)
mylayer.moveTo(100,null)
mylayer.moveTo(null,50)

The moveBy() Method:

The moveBy() method will shift the location of a layer by a specified number of pixels:

objectName.moveBy(x,y)

Example:

mylayer.moveBy(5,0)

The show() and hide() Methods:

For changing the visibility I've included the methods show() and hide(). Their are no parameters to pass so their usage is simple:

objectName.show()
objectName.hide()

In the standard DynLayer I haven't included any way to retrieve the visibility, only because I've found there's very few instances where you need to find the visibility (usually you already know if it's visible or not). But you could of course extend the DynLayer to keep track of that if need be.

Core Methods Demo:

View dynlayer-methods1.html to view an example showing usage of the core methods.

Add-on Methods

Slide Methods - slide the layer given a set of coordinates
Clip Methods - provide a solution for working with clip values

The Dynamic Layer Object API

Home Next Lesson: DynLayer Extensions
copyright 1998 Dan Steinman


Casa de Bender