[thelist] Smooth scrolling on anchor links not on same page

Christian Heilmann codepo8 at gmail.com
Tue Jan 31 16:30:52 CST 2006

On 1/31/06, Jacob Reiff <jacob at jaacob.com> wrote:
> >> Is it possible to utilize javascript to start the page at the top and
> >> then scroll (quickly, I'm not trying to be annoying here) down to the
> >> content? I think it would provide a nicer experience (if done quick
> >> enough), plus I want to make sure that users know the navigational
> >> elements are still above what they are reading.
> >
> > As for scrolling to anchors:
> > http://www.sitepoint.com/print/scroll-smoothly-javascript
> >
> I had found that link (the sitepoint tutorial) but from what I
> understood, that script only works on links that are within the same
> page. I'm talking about links that go to other pages. From my limited
> javascript knowledge, I didn't see a way to adapt that script since
> it specifically tests if the link is within the same document.

Just call the scroll function onload of the document and you should be OK.

Then again, I still consider the collapsible header idea more user
friendly, personally it freaks me out if web pages jump around or
scroll where I didn't tell them to.

Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/

More information about the thelist mailing list