Skip to content

Instantly share code, notes, and snippets.

@saleiva
Forked from anonymous/gist:4266841
Last active December 10, 2015 20:59
Show Gist options
  • Save saleiva/4492202 to your computer and use it in GitHub Desktop.
Save saleiva/4492202 to your computer and use it in GitHub Desktop.
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