Dan's Layers Tutorial
2.1  Sliding Multiple Layers

To slide 2 or more layers at the same time just requires you to add more of the same stuff.

Here are the layers I'll be using:

<LAYER NAME="layer1" LEFT=30 TOP=60>
<FONT SIZE="6" COLOR="#FF0000">Layers Page</FONT>
</LAYER>

<LAYER NAME="layer2" LEFT=300 TOP=60>
<FONT SIZE="6" COLOR="#000000">Welcome To My</FONT>
</LAYER>

The only difference between this script and the one before is that we have to move 2 layers, so we have to add 2 movement lines (in red):

function slidelayers() {
	if (document.layers['layer1'].left < 275) {
		document.layers['layer1'].left += 10;
		document.layers['layer2'].left -= 10;
		setTimeout("slidelayers()",50);
	}
}

Dan's Layers Tutorial
1.1 Introduction
1.2 Overlapping
1.3 Nesting
1.4 Using JavaScript
2.1 Sliding Layers
2.2 Pre-Built Functions
2.3 Clipping Layers
2.4 Looping Animations
2.5 Changing Images
3.1 Mouse-Click Animation
3.2 Capturing Keystrokes
3.3 Drag and Drop
4.1 Making Demos
4.4 Problems
4.5 Screen Sizes


Copyright © 1997 Dan Steinman. All rights reserved.