Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vertical scrolling web page

Status
Not open for further replies.

MartinF

Technical User
Sep 19, 2000
143
FR
Hi there,

Im about to start creating a web page to display reports. The report content will be displayed within a frame. What i am trying to achieve is to get the report to scroll verticaly until it reaches the bottom (as if you were manually pulling the scrollbar down) and then reset and strat scrolling again from the top.

I havent a clue how to do this, but do know the basics of Javascript, so if anyone can point me in the right direction, i would be most grateful

Thanks in advance
 
<HTML>
<HEAD>
<script language=&quot;javascript&quot;>
var scrollTimer;
function startScroll(){
if(document.body.scrollTop+document.body.clientHeight==document.body.scrollHeight){
window.scrollTo(0,0);
}
window.scrollTo(0,document.body.scrollTop+5);
scrollTimer=setTimeout('startScroll()',50);
}
function stopScroll(){
clearTimeout(scrollTimer);
}
</script>
</HEAD>

<BODY>
<input type=&quot;button&quot; value=&quot;Start Scrolling&quot; onclick=&quot;startScroll()&quot;>
<input type=&quot;button&quot; value=&quot;Stop Scrolling&quot; onclick=&quot;stopScroll()&quot;>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</BODY>
</HTML>

Adam
 
Thanks mate,

That works a treat

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top