L
linuxnooby
Hi
I am having a problem with setTimeout
setTimeout("Jumpup('kangaroodiv',counter)",10);
Mozilla error console says "counter not defined". Counter is defined,
so I must have the SetTimeout syntax wrong.
Below is the function it is used in Any help appreciated
Dave
function Jumpup(divname,counter) {
top = document.getElementById(divname).style.marginTop
topvalue = top.substr(0,top.length -2)
counter++;
if (counter < 40)
{
topvalue = (topvalue * 1) - 1 ;
}
else
{
topvalue = (topvalue * 1) + 1 ;
}
topstring = topvalue.toString() + 'px';
document.getElementById(divname).style.marginTop = topstring;
if (topvalue == 0 )
{
return;
}
setTimeout("Jumpup('kangaroodiv',counter)",10);
}
cheers Dave
I am having a problem with setTimeout
setTimeout("Jumpup('kangaroodiv',counter)",10);
Mozilla error console says "counter not defined". Counter is defined,
so I must have the SetTimeout syntax wrong.
Below is the function it is used in Any help appreciated
Dave
function Jumpup(divname,counter) {
top = document.getElementById(divname).style.marginTop
topvalue = top.substr(0,top.length -2)
counter++;
if (counter < 40)
{
topvalue = (topvalue * 1) - 1 ;
}
else
{
topvalue = (topvalue * 1) + 1 ;
}
topstring = topvalue.toString() + 'px';
document.getElementById(divname).style.marginTop = topstring;
if (topvalue == 0 )
{
return;
}
setTimeout("Jumpup('kangaroodiv',counter)",10);
}
cheers Dave