-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
39 lines (38 loc) · 1.02 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
var Swiper = new Swiper(".home-slider", {
loop:true,
effect: "coverflow",
grabCursor: true,
centeredSlides: true,
slidesPerView: "auto",
coverflowEffect: {
rotate: 100,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: true,
},
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
// navigation: {
// nextEl: ".swiper-button-next",
// prevEl: ".swiper-button-prev",
// },
});
let loadMoreBtn = document.querySelector('.l-home-packages .load-more .btn');
let currentItem = 3;
loadMoreBtn.onclick = () =>{
let boxes = [...document.querySelectorAll('.l-home-packages .box-container .box')];
for (var i = currentItem; i < currentItem + 3; i++){
boxes[i].style.display = 'inline-block';
};
currentItem += 3;
if(currentItem >= boxes.length){
loadMoreBtn.style.display = 'none';
}
}