Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (36 loc) · 1.54 KB
/
Copy pathscript.js
File metadata and controls
43 lines (36 loc) · 1.54 KB
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
let countWork = $('#carousel .carousel-item').length;
let currentIndexWork = $('#carousel .carousel-item.active').index() + 1;
let countReviews = $('#review-carousel .carousel-item').length;
let currentIndexReview = $('#review-carousel .carousel-item.active').index() + 1;
let $carousel = $('.cases-carousel').flickity({
"freeScroll": false,
"pageDots": false,
"prevNextButtons": false,
"cellSelector": '.carousel-cell',
"initialIndex": 1
});
let $carouselArt = $('.articles-carousel').flickity({
pageDots: false,
prevNextButtons: false,
cellSelector: '.carousel-cell'
});
$(document).ready(function(){
currentIndexWork = $('#carousel .carousel-item.active').index() + 1;
$('.number').html('<span>' + '0' + currentIndexWork + '</span>' + '/' + '0' + countWork);
currentIndexReview = $('#review-carousel .carousel-item.active').index() + 1;
$('.number-reviews').html('<span>' + '0' + currentIndexReview + '</span>' + '/' + '0' + countReviews);
});
$('#carousel').on('slid.bs.carousel', function(){
currentIndexWork = $('#carousel .carousel-item.active').index() + 1;
$('.number').html('<span>' + '0' + currentIndexWork + '</span>' + '/' + '0' + countWork);
});
$('#review-carousel').on('slid.bs.carousel', function(){
currentIndexReview = $('#review-carousel .carousel-item.active').index() + 1;
$('.number-reviews').html('<span>' + '0' + currentIndexReview + '</span>' + '/' + '0' + countReviews);
});
$('#prev').on('click', function(){
$carousel.flickity('previous');
});
$('#next').on('click', function(){
$carousel.flickity('next');
});