Help with "Go to Top of Page" functionality

Help with "Go to Top of Page" functionality

I am developing a mobile site where a page can have lots for content. I would like to have an image on the bottom of the page that goes to the top of the page. I have been playing with this sample code below but the issue that I have is that the footer navigation does not refresh. It stays on the bottom of the page. Any help would be greatly appreciated. Thanks.

$("#backtotopimg").live("click tap", function() { $.mobile.silentScroll(0); });