|
There are five parts to this script to make our objects move.
1. document.all.one.style.posLeft=-400;
This part sets the object off the screen. In this case our div is 400 pixels left of the screen.
2.
function move1() {
document.all.one.style.posLeft += 5;
if (document.all.one.style.posLeft < 10) {
setTimeout("move1()", 50); }
else { setTimeout("move2()", 200); }
This section defines the movement.
Div one, will move 5 pixels every 50 milliseconds until it is 10 pixels from the left side of the screen. Lowering the move time from 50 will speed the action.
When it reaches 10 pixels from the left our second div will move in 200 milliseconds. Lowering this number will make the objects move closer together, timewise.
3.
WeBTV Bug!! RELOAD PAGE
|