sdecima / javascript-detect-element-resize

A Cross-Browser, Event-based, Element Resize Detection
MIT License
881 stars 151 forks source link

Reset scroll positions if the dom node has been detached and reattached. #10

Closed jerjou closed 10 years ago

jerjou commented 10 years ago

Detaching a dom node will cause the scroll positions to reset to 0, causing the 'scroll' event to no longer fire when resizing. So - detect when the element is being added to the dom, and reset the scroll positions so that we can continue to detect resizes.

sdecima commented 10 years ago

This is now in v0.5.3, though I implemented the CSS animation a little bit different to avoid duplicate events being fired in some browsers. Thanks!