How to programmatically scroll window on iPad?

window.scroll not working
window scroll support
window.scroll javascript
window scroll function
window scroll callback
window scroll not working in ie
window scroll chrome
window scroll not working in mobile

My application includes several features that programmatically scroll to particular elements on a page. Unfortunately, it's not working on Safari/iPad. I have tried the following methods of scrolling:

window.scroll(0, y);

window.scrollTo(0, y);


$('html, body').animate({
    scrollTop: y

Is it simply not possible to programmatically scroll the window on Safari/iPad, or am I just doing it incorrectly? All of these methods worked for all browsers I tested on the PC.

I haven't found a way to scroll the window programmatically on iPad. One possible workaround is to wrap the page content in a fixed div container, and to scroll it by changing the div's scrollTop property. You can see that method in this codepen. I tested it successfully on iPad with Safari and Chrome, and on Windows with Firefox, Chrome and IE11.


<div id="container">
    <div class="div1"></div>
    <div class="div2"></div>
    <div class="div3"></div>


div#container {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
div {
    height: 100px;
.div1 {
    background-color: red;
.div2 {
    background-color: green;
.div3 {
    background-color: yellow;


var container = document.getElementById("container");
setInterval(function() {
    container.scrollTop += 1;
}, 20);

How to programmatically scroll in iPad for safari browser , I haven't found a way to scroll the window programmatically on iPad. One possible workaround is to wrap the page content in a fixed div container, and to scroll it  Use a two finger press inside the window that you’re trying to scroll and move them up or down simultaneously. Or pinch your thumb and forefinger together and move it up or down Also, look for a gray bar at the bottom of the text box, at the right, there is a three slanted line graphic in the corner.

javascript How to programmatically scroll window on iPad?, I want to implement window.scrollTo(x,y) functionality for iPad. It works in desktop but does not work for iPad. There are certain solutions  to programmatically scroll a `UIScrollView`. Subliminal requires this ability because, in the iOS 7 Simulator, scroll views' pan gesture recognizers fail to respond to UIAutomation drag gestures. NOTE: The implementation of this category uses a private API.

Its working fine for me on safari and iPad:

$('html, body').animate({
        scrollTop: 0
 }, 1000);

Not sure but you can try it by giving some scroll animation timings in milliseconds.

Window.scroll(), Granular control over the scroll position, even during momentum. You can always get and set the x,y coordinates of the scroller. Out of the box multi-platform  This window object is a property of the app delegate, and it’s the one window our app has. An app’s window is an important concept. In essence, the window is the app, and most iOS apps only have one window. It houses your app’s User Interfaces (UIs), dispatches events to views, and it provides a main backdrop to display your app’s content.

I use the GreenSock ScrollTo plugin which works wonders. You can grab it from their website

The advantage is that it has easing options and works on any platform, etc

$("button").each(function(index, element){
  $(this).click(function(){, 1, {scrollTo:{y:"#section" + (index+1),   offsetY:70}});

iOS 13: UIScrollView no longer scr…, The Window.scroll() method scrolls the window to a particular place in the document. I have a System.Windows.Forms.Panel with some content. I am trying to programmatically scroll the panel (vertically) either up or down. I have tried setting the AutoScrollPosition property to a new Point on the panel but that doesn't seem to do it. I have the AutoScroll property set to true.

i am using following code of jquery and it work for every browser (i dont user IE :) )

    scrollTop: 0
}, "slow");

Cross-browser scroll to top:

        $('body').scrollTop(0);         //Chrome,Safari
        if($('html').scrollTop()>0){    //IE, FF

Cross-browser a div with id = test_id:

        $('body').scrollTop($('#test_id').offset().top);         //Chrome,Safari
        if($('html').scrollTop()>$('#test_id').offset().top){    //IE, FF

How to pop a NavigationButton prog…, Now the scroll view won't move via a touch although it does move programmatically, i.e., tapping a partially obscured option scrolls it to the middle of the screen. Definition and Usage. The scrollTo() method scrolls the document to the specified coordinates. Tip: Use the scrollBy() method to scroll a specified distance multiple times.

Introducing Multiple Windows on iPad - WWDC 2019, But how in the world do you "pop" the view programatically, say, like when a user in that window, and the scroll view was intercepting the swipe down event. It works good on every browser except Safari. In Safari the touch event seems to be caught by the iframe window and will not be forwarded to the host window. Imagine this on the iPad: in over 50% of the page the user can't scroll down the page. Hardware I used for testing: Windows 8.1 (touch enabled screen) with latest version of Safari (5.1.7)

UIWebView, Multitasking is an exciting way to add power to your iPad app. It is easy to enable your app to run two instances of your interface The iOS Window. The single window that you see displayed on the iPad or iPhone is an instance of the UIWindow class. This window is created at launch time, either programmatically by you or automatically by UIKit when you use a storyboard.

Documentation Archive, In apps that run in iOS 8 and later, use the WKWebView class instead of using You can also use the scalesPageToFit property to programmatically set the scale to preserve its URL history, the scaling and scrolling positions for each page, and whether HTML5 videos play inline or use the native full-screen controller. How to programmatically scroll window on iPad? My application includes several features that programmatically scroll to particular elements on a page. Unfortunately, it's not working on Safari/iPad.

  • Did you check this answer?…
  • @KostasSiabanis - I tried that method and did not have any success (note: I am not the OP).
  • I'm just going through the queue man. Perhaps a snipped illustrating how OP would use the functionality that library provides to solve their problem?
  • Yeah, maybe so.
  • It isn't necessary to include code from the library, of course. The name of the library and a link is sufficient. But you do need to explain exactly how the library solves the person's problem. That's where this answer is lacking. See this answer for some guidance on how to improve it.
  • Thank you for the guidance.