',
''
],
}).on('changed.owl.carousel', syncPosition);
sync2
.on('initialized.owl.carousel', function() {
sync2.find(".owl-item").eq(0).addClass("current");
})
.owlCarousel({
margin: 6,
items: slidesPerPage,
dots: false,
nav: true,
smartSpeed: 200,
slideSpeed: 500,
slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel
responsiveRefreshRate: 100
}).on('changed.owl.carousel', syncPosition2);
function syncPosition(el) {
//if you set loop to false, you have to restore this next line
//var current = el.item.index;
//if you disable loop you have to comment this block
var count = el.item.count - 1;
var current = Math.round(el.item.index - (el.item.count / 2) - .5);
if (current < 0) {
current = count;
}
if (current > count) {
current = 0;
}
//end block
sync2
.find(".owl-item")
.removeClass("current")
.eq(current)
.addClass("current");
var onscreen = sync2.find('.owl-item.active').length - 1;
var start = sync2.find('.owl-item.active').first().index();
var end = sync2.find('.owl-item.active').last().index();
if (current > end) {
sync2.data('owl.carousel').to(current, 100, true);
}
if (current < start) {
sync2.data('owl.carousel').to(current - onscreen, 100, true);
}
}
function syncPosition2(el) {
if (syncedSecondary) {
var number = el.item.index;
sync1.data('owl.carousel').to(number, 100, true);
}
}
sync2.on("click", ".owl-item", function(e) {
e.preventDefault();
var number = $(this).index();
sync1.data('owl.carousel').to(number, 300, true);
});
$('#AddToCartForm').submit(function(e) {
e.preventDefault();
$('#processing').css({
'display': 'flex',
'justify-content': 'center',
'align-items': 'center'
})
$('#processing').modal('show');
$.ajax({
type: 'POST',
url: 'https://wishbazarbd.com/add-to-cart',
processData: false,
contentType: false,
data: new FormData(this),
success: function(data) {
updatecart();
$.ajax({
type: 'GET',
url: 'https://wishbazarbd.com/get-cart-content',
success: function(response) {
$('#cartViewModal .modal-body').empty().append(
response);
},
error: function(error) {
console.log('error');
}
});
$('#processing').modal('hide');
$('#cartViewModal').modal('show');
},
error: function(error) {
console.log('error');
}
});
});
// document.getElementById("istteb").click();
$('#owl-single-product').owlCarousel({
items: 1,
itemsTablet: [768, 1],
itemsDesktop: [1199, 1],
autoplay: true,
loop: true,
autoplayTimeout: 1000,
autoplayHoverPause: true,
responsiveClass: true,
dots: true,
});
});