S
S
Sergey2018-02-12 12:56:13
css
Sergey, 2018-02-12 12:56:13

How to calculate the height of all content inside a fixed block?

The body is immediately followed by a < div class="wrapper" > that contains all of the content.
This wrapper with position: fixed.
The page will not scroll because of this.
We need to calculate the height of all the content to set the height of the .wrapper or body to make the page scroll.

PS: The wrapper needs a fixed position for further use of the ScrollMagic plugin. In general, it is necessary)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2018-02-12
@fenya-fl

Something like

var heights=0;
var $kids = $(".wrapper").children();
$kids.each(function(indx, element){
  heights+= $(element).height();
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question