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