Created
September 7, 2010 02:17
-
-
Save typeoneerror/567769 to your computer and use it in GitHub Desktop.
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
$.isMobileSafari = function(){return navigator.userAgent.match(/AppleWebKit\/(.*)Mobile\//);} | |
if ($.isMobileSafari()) | |
{ | |
$("#facebook").css("position", "absolute"); | |
$.bindToBottom = function() | |
{ | |
$("#facebook").css("top", (window.pageYOffset + window.innerHeight - 30) + 'px'); | |
} | |
// sadly this does nothing as the pageYOffset is set | |
// after dom loads via objective-c "stringByEvaluatingJavaScriptFromString" | |
// or something. window.pageYOffset reports 0 on reload. | |
$.bindToBottom(); | |
// onscroll is fired when scrolling ends. it stays stuck and | |
// then jumps. looks poor, but that's the best we can get. | |
// also try touchmove. | |
$(window).bind("scroll", function() | |
{ | |
$.bindToBottom(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment