Created
August 3, 2023 16:13
-
-
Save Saoming/28913e708f0a1772e90a03c378769629 to your computer and use it in GitHub Desktop.
Splide JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleSliders { | |
splideSettings() { | |
const elms = document.getElementsByClassName('splide'); | |
for (let i = 0; i < elms.length; i++) { | |
// eslint-disable-next-line no-undef | |
new Splide(elms[i]).mount(); | |
} | |
} | |
fireWhenReady(func) { | |
// call method when DOM is loaded | |
return document.addEventListener('DOMContentLoaded', func); | |
} | |
init() { | |
this.fireWhenReady(this.splideSettings); | |
} | |
} | |
export default ExampleSliders; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment