Comments (6)
I think it is because you are calling it inmediately after mounting it, I replicated your issue but then wrapped inside a setTimeOut function and it worked
`function createSlider() {
var splide = new Splide('.splide', {
type: 'loop',
drag: 'free',
focus: 'center',
direction: 'ttb',
height: '435px',
arrows: false,
autoScroll: {
speed: 1,
},
});
splide.mount(window.splide.Extensions);
setTimeout(() => {
splide.Components.AutoScroll.pause();
}, 3000);
}
window.addEventListener('DOMContentLoaded', createSlider);`
Maybe if you don't want it to play on load, you should use the intersection extension
from splide-extension-auto-scroll.
Any update on this issue? @NaotoshiFujita OR @korneliusz-buczkowski-lemisoft
from splide-extension-auto-scroll.
is this project dead or what? π‘
from splide-extension-auto-scroll.
Why is there a need to employ setTimeout
for running the methods? It should be the default functionality, especially when it's already loading after DOMContentLoaded
. Regardless, I have decided not to use Splide anymore. π
from splide-extension-auto-scroll.
from splide-extension-auto-scroll.
I also couldn't use those methods, so I used useToggleButton instead. π
autoScroll: {
useToggleButton: true
}
https://codepen.io/ekkun/pen/ExJZbGQ
from splide-extension-auto-scroll.
Related Issues (12)
- Stabilizing speed across devices with different framerates HOT 11
- Broken ts-jest dependency
- Auto scroll doesn't work via Wordpress
- Autoscroll stopping randomly and jerking back to first slide after a while HOT 3
- auto scroll stop after it scroll one slide and keep stoped until hoverd on them this happeningin cdn version HOT 1
- Rewind: false doesn't work when the last slide is near the left edge HOT 1
- Property 'AutoScroll' of type 'AutoScrollComponent | undefined' is not assignable to string index type 'BaseComponent' HOT 2
- transform: rotate slow down autoscroll and eventually stop it HOT 1
- If autoscroll speed is negative (to play from right to left), images disappear after a while HOT 3
- Negative value not working on "slide" type. HOT 5
- Returning error `n is not a function`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from splide-extension-auto-scroll.