2018-06-28 18:43:30 +00:00
|
|
|
objectFitImages()
|
|
|
|
|
2018-06-25 15:41:18 +00:00
|
|
|
var qs = document.querySelector.bind(document)
|
|
|
|
var qsa = document.querySelectorAll.bind(document)
|
|
|
|
|
2018-06-22 15:54:48 +00:00
|
|
|
// siema carousels
|
|
|
|
var dots = qsa('.g-carousel .pagination li')
|
|
|
|
var carousel = new Siema({
|
|
|
|
selector: '.siema',
|
|
|
|
duration: 200,
|
|
|
|
easing: 'ease-out',
|
|
|
|
perPage: 1,
|
|
|
|
startIndex: 0,
|
|
|
|
draggable: true,
|
|
|
|
multipleDrag: true,
|
|
|
|
threshold: 20,
|
|
|
|
loop: true,
|
|
|
|
rtl: false,
|
2018-06-22 20:50:29 +00:00
|
|
|
onChange: function() {
|
2018-06-22 15:54:48 +00:00
|
|
|
for (var i = 0; i < dots.length; i++) {
|
|
|
|
dots[i].classList.remove('active')
|
|
|
|
}
|
|
|
|
dots[carousel.currentSlide].classList.add('active')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
// on previous button click
|
2018-06-25 15:41:18 +00:00
|
|
|
qs('.g-carousel .prev')
|
2018-06-22 15:54:48 +00:00
|
|
|
.addEventListener('click', function() {
|
|
|
|
carousel.prev()
|
|
|
|
})
|
|
|
|
|
|
|
|
// on next button click
|
2018-06-25 15:41:18 +00:00
|
|
|
qs('.g-carousel .next')
|
2018-06-22 15:54:48 +00:00
|
|
|
.addEventListener('click', function() {
|
|
|
|
carousel.next()
|
|
|
|
})
|
|
|
|
|
|
|
|
// on dot click
|
|
|
|
for (let i = 0; i < dots.length; i++) {
|
|
|
|
dots[i].addEventListener('click', function() {
|
|
|
|
carousel.goTo(i)
|
|
|
|
})
|
|
|
|
}
|