Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

augustoclaro

[Resolvido] SlideShow

Recommended Posts

Tá aí!

 

 

<html>
<head>
<title> SlideShow </title>
<script>
/*******************************************************************************
********************************************************************************
********************************************************************************
***********************CÓDIGO DE AUGUSTO CLARO**********************************
********************************************************************************
********************************************************************************
******************************************************************************/
var imgs=new Array();
imgs[0] = "<img src='img1.jpg' width='250' height='250'>";
imgs[1] = "<img src='img2.jpg' width='250' height='250'>";
imgs[2] = "<img src='img3.jpg' width='250' height='250'>";
/*
Você pode adicionar, basta adicionar mais registros na Array imgs, exemplo:
imgs[3] = "<img src='img4.jpg' width='250' height='250'>";

Vá adicionando quantas quiser.
*/
play=true;
function muda(num) {
document.getElementById("apr").innerHTML = imgs[num];
}
i = 0;
setTimeout("muda(i);",1000*1);
main();
function main() {
interval = setInterval("main2();",1000*6);
}
function main2() {
if (play==true) {
if (i == imgs.length-1) {
i=0;
}else{
i++;
}
muda(i);
}
}
function primeira() {
i = 0;
muda(i);
}
function anterior() {
if (i== 0) {
i = imgs.length-1;
}else{
i--;
}
muda(i);
}
function proxima() {
if (i == imgs.length-1) {
i=0;
}else{
i++;
}
muda(i);
}
function ultima() {
i = imgs.length-1;
muda(i);
}
function pause() {
if (play==true) {
play=false;
document.getElementById("pause").value=" :: Continuar :: ";
clearInterval(interval);
}else{
play=true;
document.getElementById("pause").value=" :: Pausar :: ";
main();
}
}
</script>

</head>
<body>
<div align="center" id="apr"> </div>
<div align="center" id="opt"><a href="#" onclick="primeira();"><b><< Primeira</b></a> <a href="#" onclick="anterior();"><b>< Anterior</b></a> <a href="#" onclick="proxima();"><b>Próxima ></b></a> <a href="#" onclick="ultima();"><b>Última >></b></a><br><br>
<input type="button" value=" :; Pausar :: " onclick="pause();" id="pause"></div>
</body>
</html>

 

É isso aí gente, espero que este script lhes seja útil!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.