Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/01/2010, 14:14
doylelives
 
Fecha de Ingreso: junio-2008
Ubicación: Capital Federal xD
Mensajes: 1.208
Antigüedad: 15 años, 10 meses
Puntos: 35
jquery problemas al buscar el index

Hola a todos:
Tengo 2 funciones, la 1° busca un elemento con la clase "select", la 2° devuelve la posicion (indice) que ocupa en un array de enlaces.
Código PHP:
var NEXT_LINK = {
    
currentLink: function() {
        var 
obj = $("#nav a.select");
        return 
obj;
    },
    
currentPosition: function(objeto) {
        var 
pos = $("#nav a").index(objeto);
        
alert(pos);
        return 
pos;
    }
};
var 
obj NEXT_LINK.currentLink();
NEXT_LINK.currentPosition(obj); 
En la 2° función el objeto llega bien pero el pos me muestra siempre -1
Que está mal?
__________________
I am Doyle please insert code.