When within a facebook app you sometimes want to scroll to the top of the page but outside of the iframe which contains your app. To do that you use the following code in javascript:
FB.Canvas.scrollTo(0,0);
This will only work when your canvas height is set to “Settable”. By default 800px. You can make in settable in the app Dashboard
The scrollTo function uses two parameters. First is x position en second is y position to scroll to.