Tutorials:

Smooth Scrolling for Inline Links

With only 8 lines of code, you can make any page scroll smoothly to inline links.

midori.addEventListener(window, 'ready', function (e) {
   midori.get('a').apply(function (o) {
      if (o.href.indexOf('#') != -1)
         midori.addEventListener(o, 'click', function (e) {
            midoriFX.scrollTo(o.href.substr(o.href.indexOf('#') + 1));
         } );
   } );
} );

And here is how it works:

You can see a live demonstration of this effect on any docs page such as midori. Just click on the method names on the left.