Someone posted this in the past so I'll re-post it considering I'd love to see if there's any custom scripts out there with this functionality. Dare I say, so I don't have to code it myself :P
Excerpt from this SO post: "I already know the jQuery plugin ScrollTo, but I didn't find any way up to now to realize the following:
The users gets to my site (by typing, NOT by clicking a link on my page) domain.com/bla.php#foo
and the anchor "#foo" exists. Now I want that the browser of the user does NOT automatically scroll to "#foo", instead I want to smoothly scroll so that the element '#foo' is about in the middle of the view and NOT on the absolute top position of the users view.
Thanks so far!"