-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
67 lines (57 loc) · 1.81 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Initialize Swiper
const swiper = new Swiper('.swiper-container', {
loop: true, // Enable infinite loop
spaceBetween: 30, // Space between slides
slidesPerView: 1, // Initial number of slides to show
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
// Pagination settings
pagination: {
el: '.swiper-pagination',
clickable: true, // Make pagination bullets clickable
dynamicBullets: true, // Dynamic size for pagination bullets
},
// Responsive breakpoints for different screen sizes
breakpoints: {
768: {
slidesPerView: 2, // 2 slides on medium screens
},
1024: {
slidesPerView: 3, // 3 slides on larger screens
},
},
});
/*
<script>
// Initialize Swiper with proper configuration
const swiper = new Swiper('.swiper-container', {
loop: true, // Allows infinite scrolling
spaceBetween: 30, // Space between slides
direction: 'horizontal', // Horizontal carousel
// Navigation arrows configuration
navigation: {
nextEl: '.swiper-button-next', // Right arrow
prevEl: '.swiper-button-prev', // Left arrow
},
// Pagination (bullets) configuration
pagination: {
el: '.swiper-pagination',
clickable: true, // Allow bullets to be clickable
dynamicBullets: true, // Dynamic size of bullets
},
// Responsive settings for the number of visible slides
breakpoints: {
0: {
slidesPerView: 1 // Show 1 slide for small screens
},
768: {
slidesPerView: 2 // Show 2 slides for medium screens
},
1024: {
slidesPerView: 3 // Show 3 slides for large screens
}
}
}); */