-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4d3695
commit eb22b9d
Showing
4 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
let empezar= document.getElementById("img"); //variable para el botón "empezar", que despliega la siguente sección | ||
empezar.addEventListener("click", mostrar) //evento del click para mostrar la sección oculta en la página | ||
|
||
function mostrar() { //función para desplegar la segunda sección del documento | ||
if (document.getElementById) { | ||
let activar = document.getElementById("info"); //se crea una variable para ubicar el div a desplegar y se ubica en el HTML | ||
activar.style.display = (activar.style.display == 'none') ? 'block' : 'none'; //damos un atributo display:none que oculta el div con una función ternaria | ||
|
||
let empezar= document.getElementsByClassName("img"); | ||
for(let i = 0 ; i < empezar.length; i++){ | ||
empezar[i].addEventListener('click', function() { | ||
mostrar(empezar[i]) | ||
}) | ||
|
||
var mostrar = function(info) { | ||
info.style.display = (info.style.display == 'none') ? 'block' : 'none'; | ||
} | ||
|
||
window.onload = function () { | ||
|
||
|
||
} | ||
} | ||
window.onload = function () { | ||
//hace que se cargue la función lo que predetermina que div estará oculto hasta llamar a la función nuevamente// | ||
mostrar("info"); //"contenido" es el nombre del DIV | ||
} | ||
|
||
|
||
// let empezar= document.getElementsByClassName("img"); | ||
// empezar.addEventListener("click", mostrar) | ||
|
||
// var mostrar = function() { | ||
// // alert('adsf') | ||
// if (document.getElementsByClassName){ | ||
// const activar = document.getElementsByClassName("info"); | ||
// activar.style.display = (activar.style.display == 'none') ? 'block' : 'none'; | ||
// } | ||
// } | ||
|
||
// window.onload = function () { | ||
|
||
// mostrar('info') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb22b9d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cambios