10

We are using javascript code to scroll to a div with the given ID. I tried to use

jQuery.animate({scrollTop: number})

window.scrollTo(0, number) 

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

I also tried to add #element_id to the url to scroll to the element_id.

None of these options are working. Is there any way to get it to work?

iOS: 9.2.1

Chrome: 48.0.2564.87

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

Avijit Nagare
  • 8,482
  • 7
  • 39
  • 68
arun15thmay
  • 1,062
  • 1
  • 9
  • 19

1 Answers1

6

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

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

This answer might explain why window.scrollTo doesn't work