First page Back Continue Last page Image

Example Code Page 1

<html>

<head>

<title>Watch me go!</title>

<script type="text/javascript" language="javascript">

<!-- Hide script from older browsers

firstTime = true

if (document.getElementById) {

stdBrowser = true

}

else {

stdBrowser = false

}

function moveIt() {

if (firstTime) {

if (stdBrowser) {

moverObj = document.getElementById("mover").style

moverObj.top = "5px"

moverObj.left = "5px"

}

if (document.all) {

maxHeight = document.body.clientHeight-100

}

else {

maxHeight = window.innerHeight-100

}

firstTime = false

}

if (stdBrowser) {

topPos = parseInt(moverObj.top) + 2

leftPos = parseInt(moverObj.left) + 2

moverObj.top = topPos + "px"

moverObj.left = leftPos + "px"

}

else {

document.mover.top += 2

document.mover.left += 2

topPos = document.mover.top

}

if (topPos < maxHeight) {

setTimeout("moveIt()",20)

}

}

// End hiding script -->

</script>

<style type="text/css">

<!--

#mover {position: absolute; left: 5px; top: 5px; font-size:36pt}

-->

</style>

</head>

<body bgcolor="white" onLoad="moveIt()">

<div id="mover">On the road again...</div>

</body>

</html>