问题
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/
回答1:
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/
来源:https://stackoverflow.com/questions/7300242/recalculating-absolute-positioned-elements-position