Skip to content

Commit

Permalink
js
Browse files Browse the repository at this point in the history
  • Loading branch information
Ballwictb committed Feb 1, 2024
1 parent 9b7a71e commit b3d0d7a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
33 changes: 28 additions & 5 deletions js/scriptClick.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@

//No evaluable -> intensidad:Poca
//No evaluable -> intensidad:Poca

let container = document.querySelector('.change-language');
let countries = container.querySelectorAll('div');
let container = document.querySelector('.change-language');
let countries = container.querySelectorAll('div');

function españa() {
//REVIEW - Creando un objeto para poder añadir los siguientes paises.

const rugged = {
"españa": () => {
for (let i = 1; i < countries.length; i++) {
if (countries[i].style.display == 'none') {
countries[i].style.display = 'block'
} else {
countries[i].style.display = 'none'
}
}
};
},
"uk": {},
"pt": {},
"it": {},
"de": {}
}


//REVIEW - Prueba superada - {Cambio a un codigo mas flexible}

/************************************************
* FUNCTION ESPAÑA() { *
* FOR (LET I = 1; I < COUNTRIES.LENGTH; I++) { *
* IF (COUNTRIES[I].STYLE.DISPLAY == 'NONE') { *
* COUNTRIES[I].STYLE.DISPLAY = 'BLOCK' *
* } ELSE { *
* COUNTRIES[I].STYLE.DISPLAY = 'NONE' *
* } *
* } *
* }; *
************************************************/
26 changes: 8 additions & 18 deletions js/scriptMouse.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
//No evaluable -> intensidad:Poca

var destiny = document.querySelector('.destiny');
var foreign = document.querySelector('.foreign');
let destiny = document.querySelector('.destiny');
let foreign = document.querySelector('.foreign');


var dashDestinations = document.querySelector('.dash-destinations');
var dashIntern = document.querySelector('.dash-intern-abroad');

let dashDestinations = document.querySelector('.dash-destinations');
let dashIntern = document.querySelector('.dash-intern-abroad');

destiny.addEventListener('mouseover', function() {
dashDestinations.style.display = 'flex';
});
destiny.addEventListener('mouseover', () => dashDestinations.style.display = 'flex');

destiny.addEventListener('mouseout', function() {
dashDestinations.style.display = 'none';
});
destiny.addEventListener('mouseout', () => dashDestinations.style.display = 'none');

foreign.addEventListener('mouseover', function() {
dashIntern.style.display = 'flex';
});
foreign.addEventListener('mouseover', () => dashIntern.style.display = 'flex');

foreign.addEventListener('mouseout', function() {
dashIntern.style.display = 'none';
});
foreign.addEventListener('mouseout', () => dashIntern.style.display = 'none');





0 comments on commit b3d0d7a

Please sign in to comment.