Well however the functions are named or structured works for me, all I know is that moving things around that much while leaving things relative messes things up (IE). So for me personally, 100% of the time I want to position the element, not leave it taking up space in the document flow. (which is what happens when you move things in relative.)

Either way. As long as I have something to make my life easier.

Ryan

Leonardo Soto M. wrote:

Ryan Nichols wrote:

Not only would you not want to, but it wouldn't matter. If the elements
set to fixed it will do nothing to set it's top and left properties.


Oops. :).

Your snippet might work for setting the position, but for the other
functions like centering the element in the window, and the fromX
functions it must be absolute.


Why?. You can calculate the absolute position to get the element where you want, and then translate it to relative.

I'd also like to add to it,

offsetFromElement(e, x, y)


Maybe adding the offset method to Coordinate would help to make it more generic?:

elementPosition(element).offset(x, y)

offsetFromMouse(x, y)


Or:

mousePosition().offset(x, y)

But how do you get the mouse position without a mouse event?.

This would be a major convenience function for generating tooltip like
items, or other contextual windows.


Yeah!

--
Leonardo Soto M.



Reply via email to