Note that there are some explanatory texts on larger screens.

plurals
  1. POscrollTop in mobile Safari not functioning
    primarykey
    data
    text
    <p>I have spent the last hour reading through the numerous questions on zooming and <code>.scrollTop()</code> and the variations of handlings and have tried at least 20 different things - everything that looked even remotely workable for my situation and I still have only a partial solution.</p> <p>I have a form that has three fields and a button to continue. The continue button opens up the rest of the form. Safari mobile zooms in when you select the textfields. I don't mind that particularly. If I prevent the zoom then it can be too small to read the fields and if I load at a readable zoom level then you can only see part of the page, so the zooming in behaviour is ok. </p> <p>The situation is that after the button is clicked and the other half of the form shows up, the window is still zoomed in and you're looking at a random patch of the page.</p> <p>From what I can envision there could be two handlings: <br /> 1) Actually zooming out after clicking the button<br /> 2) Scrolling to where the next part of the form shows up<br /></p> <p>I tried everything I could find on zooming out and handling the <code>viewport content width</code> in the <code>meta</code> tag does fire, but doesn't handle it for me as it just makes the viewport bigger or smaller and doesn't actually zoom out at all. Potentially this works for others but not for me as I have a lot of styling already in place which may make that not an option.</p> <p>I had settled for the scrolling solution and the <code>.scrollLeft()</code> is working fine, but <code>.scrollTop()</code> won't work not matter what selector I give it. I've tried:<br /></p> <pre><code>$('body').scrollTop $('html').scrollTop $('document').scrollTop $('body,html,document').scrollTop $('html:not(:animated),body:not(:animated)').scrollTop $('html:not(:animated),body:not(:animated),document:not(:animated)').scrollTop $('#content').scrollTop // that's a wrapper div $(window).scrollTop </code></pre> <p>Anybody know how to get <code>.scrollTop()</code> to work in Safari Mobile?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload