Set value on scrolltop

0

How do I set a new value in the scrolltop, instead of being 0, for example, an 'x' number.

this.liveScroller.dom.scrollTop = 563;
    
asked by anonymous 13.04.2018 / 15:45

1 answer

0

The scrollTop method works on all modern browsers:

Scroll Top

Example:

JavaScript

Window Top Scroll:

window.scrollY

Top Scroll of an element:

document.getElementsByTagName('div')[0].scrollTop

jQuery

Window Top Scroll:

jQuery(window).scrollTop();

Top Scroll of an element:

jQuery('#teste').scrollTop();
    
13.04.2018 / 16:02