But wouldn't that require the user to click?
I want to be able to reuse a DIV that a user may already have
activated on the page and scrolled down once.
If I hide it, then re-show it, it is still scrolled down. I want a way
to scroll it to the top every time it is hidden or shown.
"Pieter Van Waeyenberge" <p@foo.com> wrote in message news:<40*********************@news.skynet.be>... depending on your specific context the solution maybe less or more complex
;-)
anyway ... perhaps one of the good old 2.0 tricks: <a
href="#target">top</a><a name="target"></a>
Pieter.
"Joe" <jb*********@hotmail.com> wrote in message
news:64**************************@posting.google.c om... > I have a very simple need - I need javascript code to reset a DIV that
> the user may have scrolled down. It doesn't need to smoothly scroll or
> anything - just jump right to the top.
>
> All help gratefully received.
> Joe
Not sure if it is this what you're after:
---------8<--------8<--------8<--------
<script language='javascript'>
function move_up() {
scroll_clipper.scrollTop = 0;
}
</script>
<a href='javascript
:move_up()'>Move UP</a>
<p>
<div id='scroll_clipper'
style='position:absolute; width:150px; height: 150px; overflow:auto'>
<div id='scroll_text' style='background-color:yellow'>
Here is some content that can be scrolled.
<p>It uses two divs:<ul>
<li>scroll_clipper, and
<li>scroll_text
</ul>
scroll_clipper defines the scroll area while scroll_text
defines the text to be scrolled.
</div>
</div>
---------8<--------8<--------8<--------
hth
Rene
--
Rene Nyffenegger
http://www.adp-gmbh.ch