Edito: Le he pegado un buen vistazo a esto, no veo el error que he podido cometer por ninguna parte, a ver si me pudieras ayudar...
Código: Seleccionar todo
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="es">
<html>
<head>
<title></title>
<meta name="description" content="Animación en jQuery">
<meta name="keywords" content="jquery, javascript">
<meta name="language" content="es">
<meta http-equiv="Content-Type" content="text/html; charset = iso-8859-1" >
<script type="text/javascript" src="jquery-1.4.2.js"></script>
</head>
<body>
<button id="show1">Mostrar</button>
<button id="hide1">Esconder</button>
<img id="foto" name="fuente" style="display: none" class='imagen' src="wall1.jpg"/>
<script type="text/javascript">
NombresImg = new Array("wall1.jpg","wall2.jpg","wall3.jpg");
var i = 0;
function MostrarImg() {
if (i<=NombresImg.length-1){
fuente.src = NombresImg[i];
$('#show1').click(function() {
$("#foto").show(500, function() {
$('#foto').hide(2500)})
})
}
else {
i=0;
fuente.src=NombresImg[i];
$('#show1').click(function() {
$("#foto").show(500, function() {
$('#foto').hide(2500)})
})
}
i++;
setTimeout('MostrarImg()',3000);
}
MostrarImg();
$('#hide1').click(function () {
$('.imagen').hide();
});
</script>
</body>
</html>