Hello.

There are an unlimited number of containers per page, for example

<section class="Scrn Scrn_1 active">Lorem</section> <section class="Scrn Scrn_2">Ipsum</section> <section class="Scrn Scrn_3">Dolor</section> <section class="Scrn Scrn_4">Sit</section> <section class="Scrn Scrn_5">Amet</section> 

The first block with the class "active" position: relative; , the rest position: fixed; . When the first block is completely hidden - the class “active” should be added next to it, so that it can also be scrolled.

Please tell me how to implement?

  • Show your code and what does not work? As an option on the blocks, go over. Each () with a scroll and that's it. Well this is for jquery - Nilsan
  • @Nilsan Actually so far only a block skit. I do not know how to implement class switching. - Gargool
  • ummm ... Well, you are doing a function that is called when scrolling, in a function through .each () you run around the classes and check for example the distance from the top and based on this you give the class you need - Nilsan
  • @Nilsan for all blocks is indent = 0. How can I track the next block and then make it active? - Gargool
  • Ok, here you need a solution to the problem, but you don’t even give the conditions :-( Where do you have the first block hiding there? Up? Consider when scrolling then when the "bottom" of the block is where you need and change the class - Nilsan

0