I give up - I just can't get this to work. What elementary mistake am I making?
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function showlayer() {
var hiddenlayer = document.getElementById("test");
var layerposition = parseInt(hiddenlayer.style.left);
if (layerposition < 0) {
hiddenlayer.style.left = (layerposition + 5) + "px";
setTimeout("showlayer()", 20);
}
}
-->
</script>
<style type="text/css">
<!--
#test {
position: absolute;
left: -200px;
top: 0px;
}
-->
</style>
</head>
<body>
<div id="test">
Aaaaaaargh - please work!
</div>
<a href="javascript:showlayer()">Click me</a>
</body>
</html>