From 02e3ce06770ee74300bf47f4b36a7371444f4a6f Mon Sep 17 00:00:00 2001 From: dasemu Date: Tue, 27 May 2025 23:39:10 +0200 Subject: [PATCH] =?UTF-8?q?Correci=C3=B3n=20de=20errores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PlayerHidder.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/PlayerHidder.js b/PlayerHidder.js index b333865..b617f12 100644 --- a/PlayerHidder.js +++ b/PlayerHidder.js @@ -1,24 +1,27 @@ -(function() { - const selector = '#map-container > div > div:nth-child(1)'; - let targetDiv = null; +// PlayerHidder.js +document.addEventListener('DOMContentLoaded', function() { + const selector = '#map-container > div > div:nth-child(2)'; function hideDiv() { - targetDiv = document.querySelector(selector); + const targetDiv = document.querySelector(selector); + console.log('hideDiv:', targetDiv); if (targetDiv) { targetDiv.style.display = 'none'; } } function showDiv() { + const targetDiv = document.querySelector(selector); + console.log('showDiv:', targetDiv); if (targetDiv) { targetDiv.style.display = ''; } } - + // Oculta el div al cargar hideDiv(); - + // Expone funciones globales para mostrar/ocultar window['abrete_sesamo'] = showDiv; window['cierrate_sesamo'] = hideDiv; -})(); \ No newline at end of file +}); \ No newline at end of file