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!

Auto scrolling a <DIV> section

Status
Not open for further replies.

MartinF

Technical User
Sep 19, 2000
143
FR
Hi there,

I have a table with fixed header and footer, but scrollable table body that is defined within a <div> tag as follows:

<div style=&quot;height:450px; overflow: auto;&quot;>
<TABLE>

.......

</TABLE>
</DIV>

What i would like to achieve is to be able to automatically scroll the table body in this section from JavaScript. I can do it with an entire page by using:

window.scrollTo(0,y);

within a loop, but how do i scroll just the <DIV> section rather than the whole page?

Thanks in advance

 
You could use an IFRAME instead of a div and write the div content to the IFRAME on page load. Then you can use scrollTo().


Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top