L
L
LoveCode &Coffe2020-08-15 17:34:24
React
LoveCode &Coffe, 2020-08-15 17:34:24

Why in the slideBack and SlideNext function only 1 scroll of only 1 element works?

Link to the gallery script
I can not understand the reason for this behavior and how to fix it.

To the left and right of the little pugs) There are buttons. When you click on them, the big pug should slide AND also the small pug if it's out of view.

Big pug - main gallery with big pictures
Little pug - pagination which is also a gallery of image previews. Which slide on exactly the same principle as a
gallery. But there are still buttons on the left and right.

The problem is that in the slideBack and slideNext. Only 1 scroll works, if you specify two, then only the last one that is specified works. You can comment out a single elem.scrollIntoView or swap them around to make sure. I can't figure out why this is happening and how to fix it.

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