11 908
edições
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 100: | Linha 100: | ||
/* Teste Menu */ | /* Teste Menu */ | ||
unction showTab(tabNumber) { | |||
// Esconde todas as partes | // Esconde todas as partes | ||
var contents = document.querySelectorAll('.tab-content'); | var contents = document.querySelectorAll('.tab-content'); | ||
| Linha 107: | Linha 107: | ||
}); | }); | ||
// Remove a classe 'active' | // Remove a classe 'active' de todos os "botões" | ||
var buttons = document.querySelectorAll('.tab-button'); | var buttons = document.querySelectorAll('.tab-button'); | ||
buttons.forEach(function(button) { | buttons.forEach(function(button) { | ||
| Linha 117: | Linha 117: | ||
// Marca o "botão" como ativo | // Marca o "botão" como ativo | ||
document.getElementById('button' + tabNumber).classList.add('active'); | |||
} | } | ||
// Inicializar a função para mostrar o conteúdo da Parte 1 | |||
document.getElementById('button1').addEventListener('click', function() { | |||
showTab(1); | |||
}); | |||
document.getElementById('button2').addEventListener('click', function() { | |||
showTab(2); | |||
}); | |||
document.getElementById('button3').addEventListener('click', function() { | |||
showTab(3); | |||
}); | |||
// Mostrar a Parte 1 ao carregar a página | |||
showTab(1); | |||