Created
May 30, 2011 04:32
-
-
Save marcosrivasr/998457 to your computer and use it in GitHub Desktop.
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
<div id="contenedor"> | |
</div> |
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
var contador = -1; | |
var capa = document.getElementById("contenedor"); | |
var lista = new Array("muestra2.jpg", "muestra3.jpg","muestra4.jpg"); | |
var links = new Array("http://www.vidamrr.com", "http://www.google.com","http://wwww.facebook.com"); |
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
function slider(){ | |
if(contador >= (lista.length - 1)){ | |
contador = 0; | |
}else{ | |
if(contador < lista.length){ | |
contador++; | |
} | |
} | |
capa.innerHTML = "<a href='" + links[contador] + "'><img src='" + lista[contador] + "' height='300' width='300' /></a>"; | |
tiempo=setTimeout("slider()", 2000); | |
} |
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
slider(); |
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
<html> | |
<head> | |
</head> | |
<body> | |
<div id="contenedor"> | |
</div> | |
<script> | |
var contador = -1; | |
var capa = document.getElementById("contenedor"); | |
var lista = new Array("muestra2.jpg", "muestra3.jpg","muestra4.jpg"); | |
var links = new Array("http://www.vidamrr.com", "http://www.google.com","http://wwww.facebook.com"); | |
function slider(){ | |
if(contador >= (lista.length - 1)){ | |
contador = 0; | |
}else{ | |
if(contador < lista.length){ | |
contador++; | |
} | |
} | |
capa.innerHTML = "<a href='" + links[contador] + "'><img src='" + lista[contador] + "' height='300' width='300' /></a>"; | |
tiempo=setTimeout("slider()", 2000); | |
} | |
slider(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment