html - Get the div of current scroll offset of UIWebView -
i have 2 different html files, 2 different uiwebviews & uisegmentcontrol. on segmentchanged, had displayed webview loading html file. both html files contains common sections section content changed. want implement functionality that, when user reads section 1.1 of first webview & clicks segment loading second webview, second webview needs scroll upto section 1.1 reads in first webview , viceversa. there n number of sections. used following javacript needs parameter of current div id. on scroll, how can current visible div id. had given id each div.
function pointinview(id) { var divid = document.getelementbyid(id); divid.scrollintoview(true); return false; } anyone please me.
i think jquery might able come rescue.
could use jquery, since it's cross-browser compatible?
http://stackoverflow.com/questions/5353934/check-if-element-is-visible-on-screen check out answer form benm
Comments
Post a Comment