V
V
Vyacheslav Yashnikov2018-08-31 13:30:20
JavaScript
Vyacheslav Yashnikov, 2018-08-31 13:30:20

How to make a smooth transition between normal and page scroll sections in fullpage.js?

Hello!
I'm working on the site and ran into a problem, the site provides a combined scroll - in sections and a normal one.

I do the following to switch from page scrolling to normal scrolling:

setTimeout(function () {
                fullpage_api.setAutoScrolling(false);
            }, 1000); // ждем когда перейдет на следующую секцию и отключаем автоскролл


Switching from regular to paged like so:
var sectionPosition = $('#slide7').offset().top;  //считаем расстояние от верха страницы до секции с постраничной прокруткой               
                $('body, html').animate({
                scrollTop: sectionPosition // прокручиваем к секции
            }, 600, function () {
                setTimeout(function () {
                fullpage_api.setAutoScrolling(true); //включаем постраничный скролл 
            }, 100);
                });


The essence of the problem is this:
The user scrolls on the section with the usual scroll up, the animation of the transition to the top starts to work, but it happens in jerks, I think this is due to the fact that the normal scroll from the usual scroll has not stopped yet, and the animation of the transition is already going up. Visually on the UPD video

: the eikids.webflow.io site itself

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question