27 lines
757 B
JavaScript
27 lines
757 B
JavaScript
// PlayerHidder.js
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const selector = '#map-container > div > div:nth-child(2)';
|
|
|
|
function hideDiv() {
|
|
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;
|
|
}); |