stevenmarsh
07-11-2011, 12:58 PM
but I just can't figure it out. I have trawled the net for a solution and tried many different things that I have seen but still no luck. Maybe the answer is staring me right in the face and I just can't see it.
The code it executing the first time but as the setTimeout tries to start the second loop I get an error 'box is not defined'.
Any suggestions and explanations of what I am doing wrong much appreciated! :)
function expand(box) {
var box = document.getElementById(box);
var originalHeight = parseInt(box.style.height);
var inc = 5;
newHeight = (originalHeight + inc);
box.style.height = newHeight + "px";
int = setTimeout('expand(box)',100); }
The code it executing the first time but as the setTimeout tries to start the second loop I get an error 'box is not defined'.
Any suggestions and explanations of what I am doing wrong much appreciated! :)
function expand(box) {
var box = document.getElementById(box);
var originalHeight = parseInt(box.style.height);
var inc = 5;
newHeight = (originalHeight + inc);
box.style.height = newHeight + "px";
int = setTimeout('expand(box)',100); }