megalene
Programmer
- Jan 4, 2001
- 31
Hello All,
I am having a little problem getting my scrolling window to scroll back up. I am enclosing the current code I have, any help would be great.
<script>
<!--
function startAd() {
if (window.screen) {
pos = 0;
aw = parseInt(screen.height);
window.scrollBy(0,pos);
timerID = setInterval("moveAd()", 100);
}
}
function moveAd() {
if (pos <= 0) inc = 5;
// 5 - so it doesn't pass the right edge
// 10 - accounts for the window chrome
if (pos + 750 >= aw) inc = -5;
pos += inc;
window.scrollBy(0,pos);
}
//-->
</script>
<body onload="startAd()">
The ultimate goal is to get a window to scroll down and then back up.
I am having a little problem getting my scrolling window to scroll back up. I am enclosing the current code I have, any help would be great.
<script>
<!--
function startAd() {
if (window.screen) {
pos = 0;
aw = parseInt(screen.height);
window.scrollBy(0,pos);
timerID = setInterval("moveAd()", 100);
}
}
function moveAd() {
if (pos <= 0) inc = 5;
// 5 - so it doesn't pass the right edge
// 10 - accounts for the window chrome
if (pos + 750 >= aw) inc = -5;
pos += inc;
window.scrollBy(0,pos);
}
//-->
</script>
<body onload="startAd()">
The ultimate goal is to get a window to scroll down and then back up.