Thanks for the reply Thomas

> I don't think you meant 'fixed'. Fixed position doesn't even work
> under IE.

Yeah, I just discovered that. Ugh. I'm a little irritated at how much
the Meyer book glosses over the fact that half of what's in there is
unusable ... :/

> getElementPosition should give you the absolute position of the
> element in the page. If not it's a bug.
> 
> setElementPosition is a bit tricker because it's intended to be used
> on absolute positioned elements. The documentation could be clearer on
> this.

I think I've sorted some stuff out but maybe some questions would be
good and we could improve the docs by mentioning these gotchas? 

If I have:
<div id="container" style="position: absolute;"></div>
<div id="thing" style="position: absolute;">I'm NOT FLASH!</div>

and:

// make thing move
function rise( i ){ 
    var pos = getElementPosition('thing' );
    var new_pos = Object();
    new_pos.x = pos.x;
    new_pos.y = pos.y - 5;
    setElementPosition('thing', new_pos );
}

should thing move properly? ( up 10 pixels )? Both elements are declared
absolute and are separate in the document. I get correct behaviour in
firefox, and almost correct in IE6, but it *also* moves over 1 pixel to
the right. Setting body in the style sheet to have a border of 0 solves
this problem. That might be worth pointing out somewhere.

Now, changing the html so thing is *inside* container requires me to
also change to getElementPosition( 'thing', 'container' ) but leave
setElementPosition alone. This does seem weird and I agree that a
further explanation in the docs might be good! However, now I have the
problem that I want container to have a border, and setElement also
moves thing over to the right by the value of container's border in IE6
only. Is that the intended behaviour? And if so, what is the recommended
way to hack around that? Can anyone tell me whether ie7 fixed this
issue?

Thanks,
Iain



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to