Finding where the top of the page view is
This is sort of a hard question to describe, but here it goes:
I'm trying to completely center an element on a page (this means both horizontal and vertically). However, what I'm wondering is if there is a way, via the DOM functionality to make it so if, say, you've scrolled X-distance down the page it centers it in the current view of the page, not to the original view of the page.
Like I said, I'm not sure how to describe this very well, hope I conveyed my information.