Skip to content

Add position() #82

Open
enyo opened this Issue May 23, 2012 · 3 comments

2 participants

@enyo
enyo commented May 23, 2012

EDIT

Is there any specific reason to why the function offset() is called like that, and not position(), like in jQuery?

Since offsetLeft, etc.. all measure the offset to their next offsetParent, it seams kind of strange to have offset() return the position in the browser window...

Ok.. I'm sorry, I confused the jQuery functions. It's just that position() is missing from bonzos toolkit.

@ded
Owner
ded commented May 23, 2012

the goal of most of my core Ender modules was to reduce the cruft that you didn't need in jQuery. getting an offsetTop from an offsetParent is simple, so I didn't include it. but in either case, are you running into a real issue with it being named offset()? I preferred the name over position

@enyo
enyo commented May 23, 2012

Well.. I think that jQuery's naming convention is a bit strange here... if offsetLeft in an element is the position from an offsetParent then I would assume that offset() returns the offsets, not position().
Also: offsetLeft doesn't work as expected in IE6 + IE7, so jQuery handles that for you (but I really don't need that support.. just saying that it makes sense to wrap it).

Getting the right offsets (inside offsetParent) in inline elements is also not that obvious...

@enyo
enyo commented May 23, 2012

Also: Webkit has a very weird offset bug if an offsetParent is inline: http://jsfiddle.net/enyo/uDeZ9/ (Test it in Webkit and FF / Opera)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.