Closed jmstout closed 10 years ago
Thanks =) Do you mean relative to its .offsetParent
like the native .offsetTop
or relative to the document like jQuery.fn.offset? In some cases they are equal. You can adjust its rectangle coordinates to get the latter.
elem.offsetTop // => integer
verge.rectangle(elem).top + verge.scrollY(elem) // => like jQuery(elem).offset().top
See the jQuery source for reference. I had considered adding a verge.offset(elem)
getter a while back.
Sure thing—nice. Go for it if you want to. Otherwise I'll add them to the readme the next time I edit it. I guess I had originally debated the need for them, but they are here to stay and definitely should be in the docs.
Was wondering if there's a way for getting an element's offsetTop property or its equivalent?
Enjoying this script, thanks for the hard work thus far. :+1: