I need to push the height of each page into an array. However the/my problem is, that I need to push not the values themselves, but a running total of the values.
Here's what I've done so far:
var heights = [0];
$('.page').each(function(i) {
heights.push($(this).height());
});
The result looks like this: [0, 2000, 1000, 3000, 1500], which is the heights of the pages,
but I need something like this: [0, 2000, 3000, 6000, 7500], which is the running total of the page heights added.
[2000, 3000, 6000, 7500]?