$(function () {
$(".banner .slick").slick({
autoplay: true,
dots: true,
//arrows: true,
accessibility: true,
slidesToShow: 1,
slidesToScroll: 1,
pauseOnHover: false,
});
$('.picnewbox>ul').slick({
autoplay: true,
dots: true,
arrows: false,
accessibility: true
});
$(".s2b ul").slick({
dots: true,
arrows: true,
slidesToShow: 3,
focusOnSelect: true,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
// dots: true,
},
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
// dots: true,
},
},
{
breakpoint: 376,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
// dots: true,
},
},
],
customPaging: function (slider, i) {
return '
' + 0 + (i + 1) + '' + '-' + 0 + slider.slideCount + "
";
}
});
state_speed(".s2b", ".s2b>ul .slick-slide", ".s2b>ul");
function state_speed(doc_parent, doc_child, doc_swicth) {
var dq_state = 1;
state();
function state() {
if ($(doc_child).length > $(doc_child + ".slick-active").length) {
var all_len = $(doc_child).length - $(doc_child + ".slick-cloned").length;
} else {
var all_len = $(doc_child).length;
}
var num = dq_state / all_len * 100;
$(doc_parent + " .slick-speed span").css("width", num + '%')
}
$(doc_swicth).on("afterChange", function (item, index) {
dq_state = index.currentSlide + 1;
state()
})
}
// $(".s2b ul").slick({
// autoplay: true,
// // dots: true,
// // arrows: true,
// // accessibility: true,
// slidesToShow: 3,
// slidesToScroll: 1,
// // pauseOnHover: false,
// responsive: [
// {
// breakpoint: 769,
// settings: {
// slidesToShow: 2,
// slidesToScroll: 1,
// infinite: true,
// // dots: true,
// },
// },
// {
// breakpoint: 376,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1,
// infinite: true,
// // dots: true,
// },
// },
// ],
// });
});