I am also having problems using any javascript "scrollTo" function in an iframe on an iPad. Finally, an “old” solution to the problem was found, just a hash to the anchor.
In my situation, after returning ajax, my error messages were set to display at the top of the iframe, but if the user scrolls down in what is admittedly a long form, the view disappears and the error appears “above the crease”, Also assuming the user scrolls down the page, the top-level page was scrolled from 0.0 and was also hidden.
I added
<a name="ptop"></a>
at the top of my iframe document and
<a name="atop"></a>
at the top of the top level page
then
$(document).ready(function(){ $("form").bind("ajax:complete", function() { location.hash = "#"; top.location.hash = "#"; setTimeout('location.hash="#ptop"',150); setTimeout('top.location.hash="#atop"',350); } ) });
in iframe.
Do you have an iframe hash in front of the top page or just the iframe scrolling will scroll and the top will remain hidden, but while it’s a bit “jumpy” due to time-out intervals. My guess is that labels everywhere would allow different scroll points to be used.
G. Andrews Oct 29 '15 at 13:08 on 2015-10-29 13:08
source share