I wonder if there is an event that captures size changes of an HTML element. For example, a div with 5000px height is 4800px and Javascript onresize()
fault does not fire.
Is there an event that captures this?
HTML:
<div id="teste" style="height:1500px; background:#F00"></div>
JS:
// Evento que vai captura a mudança na altura dp documento
window.onresize = function(){
alert('mudança na altura do documento');
}
// Diminui o div para disparar o evento
setTimeout(function(){
document.getElementById('teste').style.height = '300px'
}, 3000);
Note that the height of the document is changed but the resize
event does not fire.
Thank you in advance.