You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/resources/views/segments/index/MainCategoriesSlider/MainCategoriesSlider.js

42 lines
1.0 KiB
JavaScript

import {tns} from "tiny-slider/src/tiny-slider";
var maincatz;
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('#main-cats')?.forEach(function (el) {
if (el.classList.contains('.tns-slider')) {
console.log('ignore');
return 'ignore';
}
maincatz = tns({
container: el,
items: 3,
autoplay: true,
autoplayButton: false,
// nextButton: false,
controls: false,
autoplayHoverPause: true,
mouseDrag: true,
gutter: 7,
slideBy: 1,
autoplayTimeout: 5000,
responsive: {
560: {
items: 1,
},
768: {
items: 2,
},
1000: {
items: 2,
},
1400: {
items: 3,
},
}
// speed:10000,
});
});
});