JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://meetselva.github.io/attrchange/javascripts/attrchange.js"></script>
<script>
function add() {
$('#test').append("bonk!<br />");
};
</script>
<div id="test"></div>
<div id="logger"></div>
<button onclick="add()">bonk</button>
CSS
#test {
border: 1px solid red;
}
JavaScript
$(function () {
var prevHeight = $('#test').height();
$('#test').attrchange({
callback: function (e) {
var curHeight = $(this).height();
if (prevHeight !== curHeight) {
$('#logger').text('height changed from ' + prevHeight + ' to ' + curHeight);
prevHeight = curHeight;
}
}
}).resizable();
});