Created
October 25, 2012 15:58
-
-
Save adamcbrewer/3953638 to your computer and use it in GitHub Desktop.
Revisions
-
adamcbrewer revised this gist
Dec 3, 2012 . No changes.There are no files selected for viewing
-
adamcbrewer revised this gist
Nov 7, 2012 . No changes.There are no files selected for viewing
-
adamcbrewer revised this gist
Nov 7, 2012 . No changes.There are no files selected for viewing
-
adamcbrewer revised this gist
Oct 25, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ // 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/ var scrollY = function (y) { if (window.jQuery) { -
adamcbrewer revised this gist
Oct 25, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ // Function for returning the user to any 'y' position in a Facebook app/tab. Uses jQuery animate, otherwise gracefully falls-back without it. // Source: http://stackoverflow.com/questions/7193425/how-do-you-animate-fb-canvas-scrollto & https://developers.facebook.com/docs/reference/javascript/FB.Canvas.scrollTo/ var scrollY = function (y) { if (window.jQuery) { -
adamcbrewer created this gist
Oct 25, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ // Function for returning the user to any 'y' position in a Facebook app/tab var scrollY = function (y) { if (window.jQuery) { FB.Canvas.getPageInfo (function (pageInfo) { $({ y: pageInfo.scrollTop }) .animate({ y: y }, { duration: 1000, step: function (offset) { FB.Canvas.scrollTo(0, offset); } }); }); } else { FB.Canvas.scrollTo(0, y); } };