This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function for returning the user to any 'y' position in a Facebook app/tab. Uses jQuery animate, otherwise gracefully falls-back without it. | |
// Source[1]: http://stackoverflow.com/questions/7193425/how-do-you-animate-fb-canvas-scrollto | |
// Source[2]: https://developers.facebook.com/docs/reference/javascript/FB.Canvas.scrollTo/ | |
function scrollinFacebook (toY, duration) { | |
if (FB.Canvas.getPageInfo) { | |
FB.Canvas.getPageInfo (function (pageInfo) { | |
$({ y: pageInfo.scrollTop }) | |
.animate({ | |
y: toY |