-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarrusel.js
More file actions
26 lines (24 loc) · 955 Bytes
/
carrusel.js
File metadata and controls
26 lines (24 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$(document).ready(function(){
var slickOptions = {
slidesToShow: 3, // Ajusta la cantidad de productos a mostrar
slidesToScroll: 1,
prevArrow: '<button type="button" class="slick-prev">Previous</button>',
nextArrow: '<button type="button" class="slick-next">Next</button>',
responsive: [
{
breakpoint: 740, // Ajusta el ancho máximo para el cambio de diseño
settings: {
slidesToShow: 2, // Cambia a mostrar 2 cartas en lugar de 3
}
},
],
};
$('.carousel').slick(slickOptions);
$('.carousel').on('afterChange', function(event, slick, currentSlide, nextSlide){
if (currentSlide + slick.options.slidesToShow >= slick.slideCount) {
$('.slick-next').hide(); // Oculta el botón "Next" al llegar al final
} else {
$('.slick-next').show();
}
});
});