Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/05/2009, 05:51
Avatar de javiro
javiro
 
Fecha de Ingreso: febrero-2006
Mensajes: 48
Antigüedad: 18 años, 3 meses
Puntos: 1
Busqueda Ayuda con jQuery

HOla,
estoy intentando modificar una funcinabilidad del treeview de jQuery http://docs.jquery.com/Plugins/Treeview .
Esta es la funcionalidad actual:
Código:
var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); });
				if ( current.length ) {
					current.addClass("selected").parents("ul, li").add( current.next() ).show();
				}
Ahí está comparando el href de cada enlace con la direccion actual y si coincide ejecuta la line con el show().

Lo que me gustaria hacer es que en vez de comparar las url que busque el elemento <a> que tiene un id determina y ahi ejecute el show. Como yo me lo he planteado es que en vez de esto:
Código:
return this.href.toLowerCase() == location.href.toLowerCase();
Que sea algo así:
Código:
eturn this.attr("id") == 'activo';
Y ejecute el show() cuando encuentre el elemento <a> con id='activo'.

Salud!!