I’ve found that in UIWebView, document.body is also sometimes moved. So I use:
input.onfocus = function () {
window.scrollTo(0, 0);
document.body.scrollTop = 0;
}
More Related Contents:
- iOS Safari – How to disable overscroll but allow scrollable divs to scroll normally?
- Jquery trigger click not working on safari browsers in mac, Ipad & Iphone
- Prevent users from submitting a form by hitting Enter
- Using JQuery – preventing form from submitting
- jQuery .load() call doesn’t execute JavaScript in loaded HTML file
- How can I recognize touch events using jQuery in Safari for iPad? Is it possible?
- jQuery .val() vs .attr(“value”)
- Scroll to a div using jQuery
- Get checkbox value in jQuery
- How to limit the number of selected checkboxes?
- jQuery Scroll to bottom of page/iframe
- jQuery scroll to ID from different page
- Submit form with Enter key without submit button? [duplicate]
- what’s faster? CSS3 transitions or jQuery animations?
- iPad/iPhone hover problem causes the user to double click a link
- Animate scroll to ID on page load
- jQuery disable scroll when mouse over an absolute div
- Jquery toggle event is messing with checkbox value
- jquery – keep window from changing scroll position while prepending items to a list?
- How to make Chrome remember password for an AJAX form?
- How can I make a jQuery UI ‘draggable()’ div draggable for touchscreen?
- Ajax Form submit with preventDefault
- jQuery trigger when 2/3s of div are in viewport
- HTML5 validation before ajax submit
- How to detect horizontal scrolling in jQuery?
- jQuery html attribute not working in IE
- Force a checkbox to always submit, even when unchecked
- jQuery animate scroll
- Mobile Safari $(window).height() URL bar discrepancy
- Jquery .on(‘scroll’) not firing the event while scrolling