::Mike::
Apr 25th 2009, 7:53 am
function $(id){
return document.getElementById(id);
}
function ComputedStyle(id,value){
return document.defaultView.getComputedStyle($(id), "").getPropertyValue(value);
}
function setheight(id,a){
$(id).style.height=a+'px';
}
function slide(id,duration){
height1 = ComputedStyle(id,'height').replace('px','');
i=parseInt(height1);
while(i > 0){
setTimeout("setheight('"+id+"',"+i+")",i*duration);
i=i-1;
}
}
i seems to get to 0 when I'm debugging but it doesn't change the actual height!
But then when it hits 0 it seems to change the height to 0 then smoothly make the box bigger to the original height!!
but I want it to start at 100px then smoothly close to 0px.
Anyone got any ideas on what I'm doing wrong?
return document.getElementById(id);
}
function ComputedStyle(id,value){
return document.defaultView.getComputedStyle($(id), "").getPropertyValue(value);
}
function setheight(id,a){
$(id).style.height=a+'px';
}
function slide(id,duration){
height1 = ComputedStyle(id,'height').replace('px','');
i=parseInt(height1);
while(i > 0){
setTimeout("setheight('"+id+"',"+i+")",i*duration);
i=i-1;
}
}
i seems to get to 0 when I'm debugging but it doesn't change the actual height!
But then when it hits 0 it seems to change the height to 0 then smoothly make the box bigger to the original height!!
but I want it to start at 100px then smoothly close to 0px.
Anyone got any ideas on what I'm doing wrong?