From 1ac00f4f811b057367b46b354c1cd5cc627958bb Mon Sep 17 00:00:00 2001 From: AxelCotonGutierrez Date: Thu, 3 Oct 2024 10:24:16 +0200 Subject: [PATCH] vuelta al original --- assets/js/header.js | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/assets/js/header.js b/assets/js/header.js index e7dc935c..5432f8cb 100644 --- a/assets/js/header.js +++ b/assets/js/header.js @@ -25,36 +25,16 @@ document.addEventListener("DOMContentLoaded", function() { Blog Mathematica `; - - // Código del pie de página - const footerHTML = ` - - `; - - // Insertar el encabezado en el placeholder - const headerPlaceholder = document.getElementById('header-placeholder'); - if (headerPlaceholder) { - headerPlaceholder.innerHTML = headerHTML; - } - - // Insertar el pie de página en el placeholder - const footerPlaceholder = document.getElementById('footer-placeholder'); - if (footerPlaceholder) { - footerPlaceholder.innerHTML = footerHTML; - } + + const headerElement = document.createElement('header'); + headerElement.innerHTML = headerHTML; + document.body.insertBefore(headerElement, document.body.firstChild); // Navegación: Lógica para el menú var menuToggle = document.querySelector('.menu-toggle'); var menu = document.querySelector('.menu'); - if (menuToggle && menu) { - menuToggle.addEventListener('click', function() { - menu.classList.toggle('active'); - }); - } + menuToggle.addEventListener('click', function() { + menu.classList.toggle('active'); + }); });