2005-10-27

Smooth scrolling between anchors

I found an old article about making in-page links smooth scroll today. Neat idea. It could be developed further, though, I thought, and hacked at it for a while. Then the idea of making a GreaseMonkey script out of it struck me, and a while later it was all done. Smooth scroll when clicking in-page links (userscripts.org copy here for safe-keeping) seems to work well enough too.

I experience some odd behaviour with the Mozilla 1.5 release candidate build from a few hours ago, though; the back button doesn't react when clicked on, after having clicked through an in-page link or a few, though the history object gets updated properly (and a javascript:void history.back() scriptlet still works as it should). It's just the back button proper that doesn't. It doesn't even get clickable when I follow an #in-page link. Fishy.
Categories:

3 comments:

  1. For some reason, (Windows) Opera (8.5, but perhaps other Operas too) does not consistently find correct screen coordinates to anchors on this page.

    While I may be doing rather unorthodox wizardry here, I find it a bit unsettling; Opera is after all (in my prejudiced perspective) more or less supposed to be the browser doing things right and by the book, if and when possible. Most links on my blog's index page, however, live at the fix coordinates { x:139, y:184 }, by Opera's standards. Foo?

    ReplyDelete
  2. Does this work on vertical scrolling?

    ReplyDelete
  3. It only does vertical scrolling (and horizontally scrolls to x coordinate 0, by default, always), but it's kind of easy to adapt to do either or both.

    ReplyDelete

Limited HTML (such as <b>, <i>, <a>) is supported. (All comments are moderated by me amd rel=nofollow gets added to links -- to deter and weed out monetized spam.)

I would prefer not to have to do this as much as you do. Comments straying too far off the post topic often lost due to attention dilution.

Note: Only a member of this blog may post a comment.