I globally define a variable scrollIndex
1
2;
3
(figure 4, click trigger to slide the right interface to the corresponding area)
the theory should be: click event execution (figure 1) assign scrollIndex to 1, then execute (figure 4), when the slide ends, scrollIndex is re-assigned to-1, and then executed (figure 3). The only place where scrollIndex is assigned to-1 is the initialization assignment (figure 1) and the assignment (figure 4). But what caused the value of scrollIndex to be changed to-1. Ask the great god for advice.