[thelist] Finding the position of a relative DIV

Sam sam at sam-i-am.com
Tue Jul 1 11:29:53 CDT 2003

interesting. Yes stuff will collapse and re-flow, because by making the 
image position: absolute you are removing it from the document flow.

You could switch the src of the image to a transparent gif, then create 
the new element and absolutely position it above. But if the goal is to 
actually remove the image from one place and put it into another place, 
you might be stuck.


Chris Evans wrote:
> Thanks, ppk, that seemed to work for me, but it led to other issues.  I 
> am trying to write a javascript that I can plug into any html pagewith 
> no modifications, and the JS will make the images draggable wihtout 
> having to make any modifications to the HTML.
> The problem I run into is that in order to modify the top and left 
> attributes of an html element. that element has to be absolultely 
> positioned.  My thought was to find the existing position of the image, 
> and change the style on the fly to be absolutely positioned at that same 
> location.  That works for the images, but it causes other html elements 
> to shift on the page (tables collapse, relative postioned elements move 
> around, etc).
> Any thoughts on how to accomplish this? Impossible, perhaps?
> Chris Evans
> http://www.fuseware.com

More information about the thelist mailing list