35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
$(document).ready(function () {
|
|
// Inicializar Ekko Lightbox
|
|
$(document).on('click', '[data-toggle="lightbox"]', function (event) {
|
|
event.preventDefault();
|
|
$(this).ekkoLightbox();
|
|
});
|
|
|
|
// Inicializar Filterizr
|
|
var filterizd = $('.filter-container').filterizr({
|
|
layout: 'sameSize'
|
|
});
|
|
|
|
// Manejo de clic en los botones de filtro
|
|
$('.filter').on('click', function () {
|
|
// Remover clase 'active' de todos los botones y agregarla al botón clickeado
|
|
$('.filter').removeClass('active');
|
|
$(this).addClass('active');
|
|
|
|
// Obtener el filtro correspondiente al botón clickeado
|
|
var filter = $(this).data('filter');
|
|
filterizd.filterizr('filter', filter);
|
|
|
|
// Si el filtro es "Category 1", cambiar a la siguiente pestaña (Category 2)
|
|
if (filter === "1") {
|
|
setTimeout(function () {
|
|
// Buscar el siguiente botón de categoría
|
|
var nextButton = $('.filter[data-filter="2"]');
|
|
if (nextButton.length > 0) {
|
|
nextButton.click();
|
|
}
|
|
}, 1000); // Cambiar rápidamente, puedes ajustar el tiempo si lo deseas
|
|
}
|
|
});
|
|
});
|