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