Before I ask my question, here's the offending code:
var coords = dojo.coords(g);
g.style.left = coords.x + "px";
g.style.top = coords.y + "px";
g.style.position = "absolute";
Now imagine that g
is a relatively positioned element with an x
position of 70 and a y
position of 30. If I comment out the last line of the above code, that's what dojo.coords(g)
gives me. But as soon as I add the last line, dojo.coords(g)
returns an x
position of 18, which is where the element would be if it were absolutely positioned. It seems to me that the call to dojo.coords()
shouldn't be affected by code below it, but it is.
I'm also seeing the same problem with dojo.require()
where if I call it directly before the function call that it's loading, I get an undefined error for that given function.
I'm testing in Firefox 3, but I also am noticing similar problems in Safari 3. Any ideas?