O
O
Oleg Komenda2018-01-21 20:15:32
css
Oleg Komenda, 2018-01-21 20:15:32

Animate css on scroll. How to implement?

Hello, I came up with the idea to add animate.css to the site when scrolling.
There is a script to make the animation work when scrolling:

$(window).scroll(function (){
    $(' .zoom').each(function (){
        var imagePos = $(this).offset().top;
        var topOfWindow = $(window).scrollTop();
        if (imagePos < topOfWindow+1000){
            $(this).addClass('zoomIn');
        }
    });
});

But there is a problem, on other devices, the animation does not work as it should.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Alekseev, 2018-01-25
@shure348

as I understand the animation should work when scrolling to the element,
try the viewportchecker.js plugin

V
Vitaly Herbert, 2018-03-09
@akiotwo

wow.js seems to be for this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question