1
0
This commit is contained in:
2026-04-20 15:07:14 +08:00
parent e6b59ef113
commit c16498c04d
17 changed files with 182 additions and 66 deletions

View File

@@ -479,8 +479,8 @@
if ($(".services-slider").length) {
$(".services-slider").owlCarousel({
loop:true,
margin: 30,
smartSpeed: 500,
margin: 30,
smartSpeed: 500,
responsive:{
0 : {
items: 1,
@@ -501,43 +501,89 @@
1400:{
items:3
}
}
}
});
}
/*------------------------------------------
= PRODUCT CASES TO SLIDER
-------------------------------------------*/
function buildProductCasesSlider() {
$(".cases-section").each(function() {
var $section = $(this);
var $caseLinks;
var $rows;
var $headerRow;
var $slider;
if ($section.find(".cases-slider").length || !$section.find(".product-advantages-header").length) {
return;
}
$caseLinks = $section.find(".col-md-4 > .case-card-link");
if (!$caseLinks.length) {
return;
}
$rows = $section.find(".container > .row");
$headerRow = $rows.first();
$slider = $('<div class="cases-slider"></div>');
$caseLinks.each(function() {
var $slide = $('<div class="case-slide"></div>');
$slide.append($(this));
$slider.append($slide);
});
$rows.slice(1).remove();
$headerRow.after($slider);
});
}
buildProductCasesSlider();
/*------------------------------------------
= CASES SLIDER
-------------------------------------------*/
if ($(".cases-slider").length) {
$(".cases-slider").owlCarousel({
loop:true,
margin: 30,
smartSpeed: 500,
nav: false,
dots: true,
autoplay: false,
responsive:{
0 : {
items: 1,
},
$(".cases-slider").each(function() {
var $slider = $(this);
var itemCount = $slider.children().length;
550 : {
items: 2,
center: false,
margin: 10
},
$slider.owlCarousel({
loop: itemCount > 1,
margin: 30,
smartSpeed: 500,
nav: false,
dots: true,
autoplay: itemCount > 1,
autoplayTimeout: 4000,
autoplayHoverPause: true,
responsive:{
0 : {
items: 1,
},
992 : {
items: 3,
center: false,
margin: 10
},
550 : {
items: Math.min(2, itemCount),
center: false,
margin: 10
},
1400:{
items:3
992 : {
items: Math.min(3, itemCount),
center: false,
margin: 10
},
1400:{
items: Math.min(3, itemCount)
}
}
}
});
});
}