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