var $data = new FormData();
$.ajaxSetup({
url: "/dummy_url",
type: "POST",
data: $data,
processData: false,
contentType: false,
dataType: "json",
});
$.getScript('/url');
var slider = $(sliderSelector);
var preview_slider = $(sliderPreviewSelector);
slider.owlCarousel({
items: 1,
nav: false,
dots: false,
loop: false,
onChanged: callback
});
function callback(e) {
var index = e.item.index;
preview_slider.removeClass('active').eq(index).addClass('active');
}
slide_preview.click(function () {
var index = $(this).index();
slider.trigger("to.owl.carousel", [index, 300, true]);
});
var owl = $("#team__slider").on('initialized.owl.carousel changed.owl.carousel', function(e) {
var carousel = e.relatedTarget;
if ( carousel.current() + 1 === carousel.items().length) {
setTimeout(function () {
var dots = $('#team__slider .owl-dot');
$(dots[0]).trigger('click');
}, 7000);
}
}).owlCarousel({
navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="15" height="24"><path d="M2.8 0L0 2.8 9.3 12 0 21.2 2.8 24 15 12 2.8 0z"/></svg>','<svg xmlns="http://www.w3.org/2000/svg" width="15" height="24"><path d="M2.8 0L0 2.8 9.3 12 0 21.2 2.8 24 15 12 2.8 0z"/></svg>'],
responsiveClass:true,
loop:false,
nav: true,
dots: true,
items: 1,
autoplayTimeout:7000,
autoplay:true
});
$(function() {
$('.owl-carousel').owlCarousel({
margin: 50,
responsiveClass: true,
items: 2,
nav: true,
navText: ["<img src='img/prev.png'>", "<img src='img/next.png'>"],
responsive: {
0: {
items: 1,
margin: 150,
center: true,
autoWidth: true,
nav: false,
navText: []
},
992: {
items: 2
}
}
});
const $buttons = $('здесь селектор ваших кнопок').click(function() {
$slick.slick('slickGoTo', $buttons.index(this));
});
$slick.on('init beforeChange', function(e, slick, currSlide, nextSlide) {
$buttons
.removeClass('active')
.eq(e.type === 'init' ? slick.currentSlide : nextSlide)
.addClass('active');
});