Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Ayuda con Prototype js

Estas en el tema de Ayuda con Prototype js en el foro de Frameworks JS en Foros del Web. Buenas tardes, Alguien me podría decir que falla en este código, llevo horas intentando averiguar que falla y he llegado a la conclusión de que ...
  #1 (permalink)  
Antiguo 11/03/2011, 11:43
 
Fecha de Ingreso: marzo-2011
Mensajes: 1
Antigüedad: 13 años
Puntos: 0
Pregunta Ayuda con Prototype js

Buenas tardes,

Alguien me podría decir que falla en este código, llevo horas intentando averiguar que falla y he llegado a la conclusión de que el fallo está en que no recibe la variable direction...
Pero no sé como arreglarlo.

El código es este:

document.observe('dom:loaded', function()
{
l1 = new Slider('slider','next','prev');
});

function Slider(ele,left,right)
{
this.current = 0;
this.items = $(ele).getElementsByTagName('li');
this.count = this.items.length;

for(i=0;i<this.count;i++)
{if(i!=0) this.items[i].style.display = 'none';}

this.slide = function(direction)
{
Effect.Fade(this.items[this.current]);
if(direction == 'fw')
{if (this.current == (this.count-1)) { this.current = 0; } else { this.current++; }}
else if(direction=='prev')
{if (this.current == 0) { this.current = (this.count-1); } else { this.current--; }}
Effect.Appear(this.items[this.current]);
}

$(left).observe('click',this.slide.bindAsEventList ener(this,'fw'));
$(right).observe('click',this.slide.bindAsEventLis tener(this,'prev'));
}

Gracias de antemano.
Saludos.

Etiquetas: ajax, prototype, slide
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:01.