I\'ve the following sample html, there is a DIV which has 100% width. It contains some elements. While performing windows re-sizing, the inner elements may be re-positioned,
A new standard for this is the Resize Observer api, available in Chrome 64.
function outputsize() {
width.value = textbox.offsetWidth
height.value = textbox.offsetHeight
}
outputsize()
new ResizeObserver(outputsize).observe(textbox)
Width:
Height:
Spec: https://wicg.github.io/ResizeObserver
Polyfills: https://github.com/WICG/ResizeObserver/issues/3
Firefox Issue: https://bugzil.la/1272409
Safari Issue: http://wkb.ug/157743
Current Support: http://caniuse.com/#feat=resizeobserver