$(window).on("resize", function () {
var totalHeight = 0
var $p = $("#cwt-help").children();
$p.each(function () {
totalHeight += $("#cwt-help").outerHeight();
});
$("#cwt-help").css({ "height": totalHeight })
});
I'm attempting to dynamically adjust the height of a parent div to match the height of its child element upon window resize. The issue I'm encountering with this code is that it retrieves the height before the resize event occurs. How can I accurately get the resulting height after resizing? Thanks!