January 2001
Beginner
312 pages
6h 4m
English
Want to go up and down instead of side to side? Easy! All you need to do is use the pixelTop attribute instead of pixelLeft.
Here is a simple modification of the Internet Explorer example to do just that:
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!
function moveTxt()
{
if (ani1.style.pixelTop < 500)
{
ani1.style.pixelTop += 2;
setTimeout("moveTxt()", 50);
}
}
// Cloaking device off -->
</script>
</head>
<body onLoad="moveTxt()">
<div id="ani1" style="position:absolute;left:10;top:10">
Text ... on the go!
</div>
</body>
</html>
Now, here's the same modification for the Netscape Navigator example. This substitutes the attribute top for left:
<html> <head> <title>A Simple Page</title> ...
Read now
Unlock full access