I'm using the jQuery positioning plugin from jQuery UI:
http://wiki.jqueryui.com/w/page/12138026/Position
Positioning works well enough to set a item next to an existing item on开发者_运维百科 the page. the problem is if the item on the page moves or goes away, then the positioned item stays there and doesn't get removed or reposition.
Is there a way to make positioning an item dynamic based on the anchor element? Thanks
Position()
just sets the element to a position relative to given element one time and doesn't watch for it's movement afterwards. If the element to which you're positioning another one changes position you have to call position()
again. If it animates, you'll have to animate both elements.
精彩评论