Any ideas on why this script isnt working, I think I've turned into an idiot.![]()
Feel free to tear it apart.
<html>
<head>
<title>
Test Interface
</title>
<script languange="Javascript" type="text/javascript">
var gotolevel = 200;
var prevlevel = 50;
function resize(target)
{
target = document.getElementById(target);
target.style.height = prevlevel;
prevlevel = target.style.height;
if(prevlevel < gotolevel)
{
target.style.height = prevlevel+10;
if(prevlevel < gotolevel)
{
setTimeout("resize()", 1);
}
}
else if(prevlevel > gotolevel)
{
target.style.height = prevlevel-10;
if(prevlevel > gotolevel)
{
setTimeout("resize()", 1);
}
}
else
{
//null condition
}
}
</script>
</head>
<body onload="resize('box1')">
<div id="box1" style="border: solid black 1px;">
The "Dynamic" Div
</div>
<div>
<hr />
The other Div
<hr />
</div>
</body>
</html>
It should set the height of the division to the 'prevlevel' (which it does) then gradually increment it until it's the size of 'gotolevel' (which it dont).
I'm lost



Simple things for simple minds eh.

Bookmarks