Z
Z
zuraavl2015-10-29 17:18:02
JavaScript
zuraavl, 2015-10-29 17:18:02

How to add and remove a class on call?

My attempts to find a script that can distribute classes when the scroll approaches an element with the specified class (or there may be many of these elements) and remove these classes if we go up - did not bring success.
Maybe you have ready-made solutions?

I know wow.js, but it can't delete and I don't need Animate.css
waypoints - completely incomprehensible thing

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Inchin ☢, 2015-10-29
@zuraavl

The most primitive version: https://jsfiddle.net/In4in/rbdterkj/
I will pay attention to the following piece of code:

{
  distance : wH / 3    //Высота окна, деленная 3
}

This parameter is responsible for the distance from the edge of the window, at which the class will be assigned / subtracted from the block. Below is an example image. Blue lines are class switching boundaries.
6df189e0bf19456abbd65f11844e247e.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question