Z
Z
zekin3752020-08-04 10:44:01
css
zekin375, 2020-08-04 10:44:01

How to make the correct scroll down on the mobile version?

Help to implement the task, it is required on the site in the mobile version to implement what would be clicked to the next div when scrolling down.

Whatever it is not smooth, namely the transition to the next block.

For example, how it is currently clicked in the TikTok application

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-08-04
@Kozack

zekin375 ,
I can offer two options, but I don’t know which one is better and more affordable

  1. First
    1. Track the scroll event.
    2. override default behavior

  2. Second
    1. Block scroll completely
    2. Track touches and gestures

  3. Next, you calculate the screen dimensions of the device, the dimensions of your sections, the current scroll position (if there is one), or the content shift if there is no scroll.
  4. Perform operations to move the viewport to the desired section.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question