-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
22 lines (18 loc) · 763 Bytes
/
Copy pathscripts.js
File metadata and controls
22 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function mostrarTabla(id) {
const secciones = document.querySelectorAll('.tabla-contenido');
secciones.forEach(sec => sec.classList.remove('activa'));
const mostrar = document.getElementById('tabla-' + id);
if (mostrar) {
mostrar.classList.add('activa');
}
// Quitar clase 'activo' de todos los botones
const botones = document.querySelectorAll('.tabs button');
botones.forEach(btn => btn.classList.remove('activo'));
// Agregar clase 'activo' al botón presionado
const botonActivo = document.querySelector(`.tabs button[onclick*="${id}"]`);
if (botonActivo) botonActivo.classList.add('activo');
}
// Mostrar "Normal" por defecto al cargar
window.addEventListener('DOMContentLoaded', () => {
mostrarTabla('normal');
});