diff --git a/js/scriptClick.js b/js/scriptClick.js index f7a3b551..8fd1028f 100644 --- a/js/scriptClick.js +++ b/js/scriptClick.js @@ -1,10 +1,13 @@ - //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' @@ -12,4 +15,24 @@ countries[i].style.display = 'none' } } - }; \ No newline at end of file + }, + "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' * + * } * + * } * + * }; * + ************************************************/ \ No newline at end of file diff --git a/js/scriptMouse.js b/js/scriptMouse.js index dea6c1f9..03bce78d 100644 --- a/js/scriptMouse.js +++ b/js/scriptMouse.js @@ -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'); - \ No newline at end of file