Sunday, September 16, 2012

iOS UIWebView issue

When UIWebView scrolls its content, it freeze all JavaScript events until the end of scroll. So you absolutely can not programmatically observe and/or control the scrolling process like this common way:
window.onscroll = function() {
    var scrolled = window.pageYOffset || document.documentElement.scrollTop;
    // do something
}
because variable 'scrolled' will be updated only once - after the scroll is completely finished.

1 comment: