tedteeter
03-11-2014, 12:18 AM
Greetings, March 10th 2014
The below is a function the scrolls down a div and it works great, however, I have attempted several ways to reverse the scroll downwards to return the div to it's original position and erratic numbers are generated even after clearing the variables, intervals etc. I even set different variables and attempted a setinterval for the flydown function and a TimeOut for the flyup function but I am still getting erratic numbers?? Any ideas? ## An UPDATE ## I now have the functions reverse and it works great, however, now that I use CSS display block it flashes off an on as it appears that the clearIntervals aren't working correctly..again any ideas?
function flyDown(){
y=k++;
var x=document.getElementById('dmenudiv');
if(y>300){
//alert('here in clear');
stopexpand();
document.getElementById('opaque').style.display='block';
}else{
x.style.visibility='visible';
x.style.height = y+'px';
if(y<150){
x.style.top = y+'px';
}
x.style.zIndex='100';
expandInterval = setInterval(function(){flyDown()}, 75);
}
}
The below is a function the scrolls down a div and it works great, however, I have attempted several ways to reverse the scroll downwards to return the div to it's original position and erratic numbers are generated even after clearing the variables, intervals etc. I even set different variables and attempted a setinterval for the flydown function and a TimeOut for the flyup function but I am still getting erratic numbers?? Any ideas? ## An UPDATE ## I now have the functions reverse and it works great, however, now that I use CSS display block it flashes off an on as it appears that the clearIntervals aren't working correctly..again any ideas?
function flyDown(){
y=k++;
var x=document.getElementById('dmenudiv');
if(y>300){
//alert('here in clear');
stopexpand();
document.getElementById('opaque').style.display='block';
}else{
x.style.visibility='visible';
x.style.height = y+'px';
if(y<150){
x.style.top = y+'px';
}
x.style.zIndex='100';
expandInterval = setInterval(function(){flyDown()}, 75);
}
}