I need to find the distance between the element and the bottom of the browser window.

When I select the element, and the distance between the element and the bottom of the browser window is smaller than 50px, I want to make the window scroll automatically.

Any ideas? I'd prefer to use jQuery.

Edit
Report