The cleanest example I have seen for this feature is by Sergey Akopov.
Sergey implement a jQuery example that works wonderfully! Here is the link to the article. I attached the ZIP file same code, which is on Sergey's site as well.
MaintainScroll.zip (3.01 kb)