1

I am calling:

window.scrollTo(0,this.stateModel.get("scrollY"));

in phonegap in a view's render function.

This code works on the android emulator, but not on the iPhone 6.0 emulator.

Is there any reason scrollTo wouldn't work on IOS?

Joshua Dwire
  • 5,415
  • 5
  • 29
  • 50
storm_m2138
  • 2,281
  • 2
  • 20
  • 18

1 Answers1

0

I had issues with this as well. As a workaround, I simply created an anchor element in the desired position and then invoked a click event on a hidden anchor link.

<a class="anchor" href="#desiredLocation" style="display: none;"></a>
<a id="desiredLocation"></a>

jQuery code...

$(".anchor").click();

Not the most elegant solution, but it provides the same behavior.

Ryan Berger
  • 9,644
  • 6
  • 44
  • 56