Get scroll position using jquery

javascript, jquery

Solution

cross browser variant

$(document).scrollTop();

Problem

Strange request, but I need to get the current browser scroll position as a variable. What js or jquery function should I use? I need it to figure out what elements to display on the side. I've found a few things online but nothing that works for my div, just the full page.

Original source