-
-
Save saleiva/4492202 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
var t; | |
var posicion=0; | |
var mi_array=new Array(); | |
//numero de diapositivas | |
//n es el numero de parámetros. | |
function presentacion(n){ | |
for(var i=0; i<=n; i++){ | |
mi_array[i]=i; | |
} | |
console.log('presentación creada. '+n+' diapositivas creadas'); | |
} | |
function siguiente(){ | |
if(posicion==mi_array.length){ | |
console.log('fin'); | |
clearInterval(t) | |
}else{ | |
posicion=posicion+1; | |
console.log('Estas en la posición '+posicion); | |
} | |
} | |
function anterior(){ | |
if(posicion==0){ | |
console.log('fin'); | |
}else{ | |
posicion=posicion-1; | |
console.log('Estas en la posición '+posicion); | |
} | |
} | |
function auto(msegs){ | |
t = setInterval(function(){siguiente()},msegs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment