You can include the JS and CSS files in the <head>
.
<svelte:head>
<link rel="stylesheet" href="/glider.min.css"><!-- path to you CSS file -->
<script src="/glider.min.js" /><!-- path to you JS file -->
</svelte:head>
Then in your <script>
you'll need to target the element with .slider
class to properly instantiate the glider slider.
<script>
import { onMount } from 'svelte';
onMount(() => {
new Glider(document.querySelector('.glider'), {
slidesToShow: 1,
dots: '#dots',
draggable: true,
arrows: {
prev: '.glider-prev',
next: '.glider-next'
}
});
})
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…