What you described is caused by the fact that it's still executing the default behavior of a click to avoid this you either use return false or event.preventDefault(); e.g. (assuming the same mark-up)
You may want to change the selector to something more appropriate if using the first two examples, and as Fumigator stated you want to try and stay away from inline events such as onclick and use code like what I provided you with.
// Alternatively you can do
// Or using your current code
<a href="#" onclick="$.scrollTo( '#header', 900 ); return false;">up</a>
It's basically the same concept behind the separation of content (HTML) and presentational (CSS) except we're throwing in the behavioral layer (JS).