How does swiper add a progress navigation bar?

swiper officially comes with a progress navigation bar, but it"s not what I need. I want that, for example, if autoplay is set to 5000, the progress navigation bar will gradually increase by a percentage, and when it reaches 5000 milliseconds, the swiper will turn to the second page, and the progress navigation bar will start at 0 and re-perform the increase from 0 to 100%. It"s the same after turning the page on the left and right. May I ask how to achieve this effect? If you can still hope to give an answer, thank you very much! ~


write a progress bar directly. Whenever you enter the page turning callback, add a class . This class adjusts the progress bar to 100% , and adds the transition of transition:5s . Every time you turn the page, you can remove this class and not add

.
Menu