Skip to content

Commit

Permalink
feat(autoplay): all new Autoplay module
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Nov 23, 2022
1 parent 771a16e commit 1b4ac21
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 160 deletions.
6 changes: 5 additions & 1 deletion src/core/events/onResize.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
let timeout;
export default function onResize() {
const swiper = this;

Expand Down Expand Up @@ -37,7 +38,10 @@ export default function onResize() {
}

if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
swiper.autoplay.run();
clearTimeout(timeout);
timeout = setTimeout(() => {
swiper.autoplay.resume();
}, 500);
}
// Return locks after resize
swiper.allowSlidePrev = allowSlidePrev;
Expand Down
Loading

0 comments on commit 1b4ac21

Please sign in to comment.