benst
benst

Reputation: 553

javascript window.scrollto issue on Ipad

I have a javascript that includes following line of code:

window.scrollto(x,y);

where x and y are the coordinates of the position where there should be scrolled.

This works fine on desktop computers but if I try it on an Ipad it does not scroll properly.

If I put an alert() statement before the window.scroll command it srolls properly. Does anyone know of a fix? Btw the ipad uses ios7.

Thanks

Upvotes: 1

Views: 9077

Answers (1)

Yjae Dalina
Yjae Dalina

Reputation: 106

do this:

window.setTimeout(function() {window.scrollTo(x,y);}, 0);

also be aware of the case, scrollto is different to scrollTo in javascript.

Upvotes: 1

Related Questions