Mudar style
Fala galera beleza?Eu to tentando fazer um script para fazer uma div mudar o style dela a cada 5 segundos. Ou seja a cada 5 segundos uma div troca de block para none e outra de none para block. Eu to fazendo aqui,só que nem erro está dando para ver onde está o erro. Se alguém puder me dar uma luz nesse caso, vlw...
function (){
var ban_1 = document.getElementById('app1');
var ban_2 = document.getElementById('app2');
var ban_3 = document.getElementById('app3');
var temp = setInterval(5000);
var temp2 = temp++;
var temp3 = temp2+temp;
if(temp){
ban_1.style.display = 'block';
ban_2.style.display = 'none';
ban_3.style.display = 'none';
}
if(temp2){
ban_1.style.display = 'none';
ban_2.style.display = 'block';
ban_3.style.display = 'none';
}
if(temp3){
ban_1.style.display = 'none';
ban_2.style.display = 'none';
ban_3.style.display = 'block';
}
}
<div id="app1" style="display:block;">
teste
</div>
<div id="app2" style="display:none;">
teste2
</div>
<div id="app3" style="display:none;">
teste3
</div>Discussão (2)
Carregando comentários...