Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recalculating absolute positioned elements position?

I have some elements positioned absolutely, relative to document body.

When something is appended, somewhere inside DOM, then absolute positioned elements should be repositioned as well.

The question is, how to know that DOM was changed somewhere there inside?

The second idea was to listen to document height and width changes, which i think is the most efficient way to do it.

Are there any other ways to accomplish that?

UPDATE http://jsfiddle.net/9nkq9/

like image 609
Somebody Avatar asked Sep 04 '26 16:09

Somebody


1 Answers

Do the absolutely positioned elements need to be positioned relative to the body?

By wrapping them in a container positioned relative you can acheive the result as I understand it:

http://jsfiddle.net/9nkq9/1/

like image 189
Jamie Dixon Avatar answered Sep 07 '26 09:09

Jamie Dixon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!