homepage button - javascript

0

I'm trying to make a particular button, on click, get you back to the homepage.

As I'm mostly working with Javascript (I can not use j-query), I'm creating functions that delete the current elements and display the elements corresponding to the home page.

However, it is not working. Nor do I understand how to have this function on all "pages" (it's just an HTML page).

javascript page "homepage"

function showPagina2(){

var historias = document.getElementById("historias");

var hist1 = document.getElementById("hist1");
hist1.id="hist1";
hist1.style.opacity = "0.0";
historias.appendChild(hist1);

var hist2 = document.getElementById("hist2");
hist2.id="hist2";
hist2.style.opacity = "0.0";
historias.appendChild(hist2);

var hist3 = document.getElementById("hist3");
hist3.id="hist3";
hist3.style.opacity = "0.0";
historias.appendChild(hist3);

var textoabrigo= document.getElementById("textoabrigo");
textoabrigo.id="textoabrigo";
textoabrigo.style.opacity = "0.0";
historias.appendChild(textoabrigo);



showHeader();
startFadeInPagina2();

}



 function showDivPagina2(){

var div2 = document.getElementById('historias').style.visibility = 
 "visible";

 }

 //esconder div histórias do início 

function divHistorias() {
var x = document.getElementById('historias');
if (x.style.visibility === 'hidden') {
    x.style.visibility = 'visible';
} else {
    x.style.visibility = 'hidden';
}
}

HTML

When you click on logoheader, the present content should disappear and the homepage should appear. I can make things go away, but I can not return to the initial.

<div id="header">
<button id="logoheader" onclick="hideDivHistorias(); showPagina2(); 
showDivPagina2();">
<img width= 150px src="image/logo.png">
</button>
</div>
    
asked by anonymous 04.06.2018 / 23:54

0 answers