Simple example get size of content and position of scroll for UIWebView!

1
2
3
4
5
6
int scrollPosition = [[webView stringByEvaluatingJavaScriptFromString:@"window.pageYOffset"] intValue];

int sizePage = [[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"foo\").offsetHeight;"] intValue];

//Scroll UIWebView to point
[webView stringByEvaluatingJavaScriptFromString: [NSString  stringWithFormat:@"window.scrollBy(0,%d);", 100] ];