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
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
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)