Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add position() #82

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

Add position() #82

enyo opened this issue May 23, 2012 · 3 comments

Comments

@enyo
Copy link

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
Copy link
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
Copy link
Author

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
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants