What should the best practices to listen on element resize event?
I want to re-position an element (jQuery dialog in my case), once it\'s size changed. But I am now more
Well, there is a easy library for that. Although there's nothing official how to listen on dimension changes of all types of elements and only window
supports it at the moment we have luckily a polifill for that that works very accurate and supports all browsers even inclusive IE6+.
https://github.com/marcj/css-element-queries
You can find there a class ResizeSensor
. To setup a listener on a element you can just do:
new ResizeSensor($('.myelements'), function() {
console.log('changed');
});