Position scroll - JQUery - JS

0

Hello,

I'm having trouble making a script in which I have the following structure

Where the header and footer are fixed and main has a scroll with the content. I would like to know how to get the position of the main scroll?

Thank you

    
asked by anonymous 10.07.2016 / 21:54

1 answer

2

Index the scrollTop method within your #main element. It will return to the vertical position. You can index scrollLeft if you want the horizontal position.

var $main = $('#main');
$main.scrollTop();

(I hope you're talking about the native scroll)

    
10.07.2016 / 23:30