var satual =1; smax=3; stmp=3000;
// ocultando os tres imagens e exibindo o 1º function troca(){ document.getElementById("b1").style.visibility="hidden"; document.getElementById("b2").style.visibility="hidden"; document.getElementById("b3").style.visibility="hidden";
var satual =1;
smax=3;
stmp=3000;
// ocultando os tres imagens e exibindo o 1º
function troca(){
document.getElementById("b1").style.visibility="hidden";
document.getElementById("b2").style.visibility="hidden";
document.getElementById("b3").style.visibility="hidden";
// exibindo imagem atual
document.getElementById("b"+satual).style.visibility="visible";
satual=satual+1;
if(satual>smax){
satual = 1;
}
}
// funcao de iniciar o slider function slider(){ document.getElementById("b1").style.visibility="hidden"; document.getElementById("b2").style.visibility="hidden"; document.getElementById("b3").style.visibility="visible";
}
// funcao de iniciar o slider
function slider(){
document.getElementById("b1").style.visibility="hidden";
document.getElementById("b2").style.visibility="hidden";
document.getElementById("b3").style.visibility="visible";
// chama uma funcao a cada tempo
interval=setInterval(troca,stmp);
}
function next(){
}
function next(){
clearInterval(interval);
satual++;
if(satual>smax){
satual = 1;
}
document.getElementById("b1").style.visibility="hidden";
document.getElementById("b2").style.visibility="hidden";
document.getElementById("b3").style.visibility="hidden";
// exibindo imagem atual
document.getElementById("b"+satual).style.visibility="visible";
interval=setInterval(troca,stmp);
}
function anterior(){
}
function anterior(){
clearInterval(interval);
satual--;
if(satual>smax){
satual = 1;
}
if(satual<1){
satual=3;
}
document.getElementById("b1").style.visibility="hidden";
document.getElementById("b2").style.visibility="hidden";
document.getElementById("b3").style.visibility="hidden";
// exibindo imagem atual
document.getElementById("b"+satual).style.visibility="visible";
interval=setInterval(troca,stmp);
}
}