Versión final.
This commit is contained in:
parent
ebdc15a55c
commit
9e22454750
@ -1,28 +1,27 @@
|
||||
// PlayerHidder.js
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('PlayerHidder.js loaded');
|
||||
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';
|
||||
}
|
||||
}
|
||||
// Localizaión del div que contiene los iconos de los jugadores
|
||||
const selector = '#map-container > div > div:nth-child(2)';
|
||||
|
||||
function showDiv() {
|
||||
const targetDiv = document.querySelector(selector);
|
||||
console.log('showDiv:', targetDiv);
|
||||
if (targetDiv) {
|
||||
targetDiv.style.display = '';
|
||||
// Oculta el div que contiene los iconos de los jugadores
|
||||
function hideDiv() {
|
||||
const targetDiv = document.querySelector(selector); // Selecciona el div usando el selector CSS
|
||||
if (targetDiv) { // Verifica si el div existe
|
||||
targetDiv.style.display = 'none'; // Cambia el estilo de display a 'none' para ocultarlo
|
||||
}
|
||||
}
|
||||
|
||||
// Muestra el div que contiene los iconos de los jugadores
|
||||
function showDiv() {
|
||||
const targetDiv = document.querySelector(selector); // Selecciona el div usando el selector CSS
|
||||
if (targetDiv) { // Verifica si el div existe
|
||||
targetDiv.style.display = ''; // Cambia el estilo de display a '' para mostrarlo
|
||||
}
|
||||
}
|
||||
|
||||
// Oculta el div al cargar
|
||||
hideDiv();
|
||||
// Inicializa el script ocultando el div
|
||||
hideDiv();
|
||||
|
||||
// Expone funciones globales para mostrar/ocultar
|
||||
window['abrete_sesamo'] = showDiv;
|
||||
window['cierrate_sesamo'] = hideDiv;
|
||||
});
|
||||
// Exponer las funciones para que puedan ser llamadas desde el contexto global
|
||||
window['abrete_sesamo'] = showDiv;
|
||||
window['cierrate_sesamo'] = hideDiv;
|
||||
Loading…
x
Reference in New Issue
Block a user