Discussion Javascript

ResizeObserver Polyfill

A polyfill for the Resize Observer API.

Implementation is based on the MutationObserver and uses Mutation Events as a fall back if the first one is not supported, so there will be no polling unless DOM changes. Doesn’t modify observed elements. Handles CSS transitions/animations and can possibly observe changes caused by dynamic CSS pseudo-classes, e.g. by :hover.

Live demo (has style problems in IE10 and lower).

https://github.com/que-etc/resize-observer-polyfill

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *