...

View Full Version : Scrollbar Problem



prongs4lily
03-12-2007, 09:02 PM
I'm using this tag to make a div's scrollbar move to the top:

<div id="scroll"> <p id="top">blah blah blah</p> <!-- more content --> <a href="#top">Top</a></div>

When you click on the 'Top' link it does send the div's scrollbar back to the top. However, it also sends the main window's scrollbar to the bottom.Does anyone know how I can stop this happening?

jlhaslip
03-12-2007, 09:53 PM
Try moving the id to a named anchor outside of the p-tag


<div id="scroll">
<a id="top"></a>
<p >blah blah blah</p>
<!-- more content -->
<a href="#top">Top</a>
</div>

Or maybe target the div id instead of "top":


<div id="scroll">

<p >blah blah blah</p>
<!-- more content -->
<a href="#scroll">Top</a>
</div>

Any chance you could post a link to a sample page?

prongs4lily
03-12-2007, 10:04 PM
here's a link to a sample page:

http://munro.arts.gla.ac.uk/0305612F/mmcourse/project/html/index.htm#top

jlhaslip
03-12-2007, 10:40 PM
Nope, the suggestions above don't work.
Any chance you could solve some of the warnings the validator issues? Never know if that might be causing the problem.
For instance, there are 4 warnings about invalid id's and names. Not the ones you are referencing, but ???

rmedek
03-13-2007, 04:28 AM
hm… it's actually sort of browser behavior. How about changing the link to "#" rather than "#top"? That'll effectively reload the same window (thus resetting all the scrollbars back to the top of the page).

prongs4lily
03-13-2007, 08:11 PM
That didn't work either. The main window's scrollbar went back to the top but the div's scrollbar didn't move. Any other thoughts?

prongs4lily
03-16-2007, 04:13 PM
That didn't work either. The main window's scrollbar went back to the top but the div's scrollbar didn't move. Any other thoughts?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum