Window.scrollTo not working in iOS chrome

We use javascript code to scroll to the div with the given identifier. I tried to use

jQuery.animate({scrollTop: number})

window.scrollTo(0, number) 

setTimeout(function() {window.scrollTo(0, number);}, 1000)

I also tried adding #element_idto the url to navigate to the element_id element.

None of these options work. Is there any way to make it work?

iOS : 9.2.1

Chrome : 48.0.2564.87

http://jsfiddle.net/fXx6c/114/

+4
source share
1 answer

You can use window.scroll () instead. I tested your jsfiddle and it worked. Usage will be the same as window.scrollTo ().

For example: window.scroll(0, 485);

, window.scrollTo

0

Source: https://habr.com/ru/post/1627760/


All Articles