Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2020 07:28
What would you like to do?
jQuery calculate parent height by sum up childrens height
var parentHeight = $.map($('.parent > *'), function (i) {
return ($(i).height())
}).reduce(function (accumulator, currentValue) {
return accumulator + currentValue;
}, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment