Yes, there is no simple solution, this is not good.
I found something very useful for myself: resize an element based on a cross browser
This is tricky by adding some necessary html to the element to be listened to and detects a scroll event.
Html example from this page:
<div class="resize-triggers"> <div class="expand-trigger"><div></div></div> <div class="contract-trigger"></div> </div>
Also some JS:
var myElement = document.getElementById('my_element'), myResizeFn = function(){ }; addResizeListener(myElement, myResizeFn); removeResizeListener(myElement, myResizeFn);
But it works for elements that may have children, not for self-closing tags.
You can see the demo http://jsfiddle.net/3QcnQ/67/
George Garchagudashvili
source share