[jQuery] [treeview] highlight
Hi,
I'm using the latest release of the treeview plugin together with
jquery 1.2.6
Everything works nice, I'm using regular <ul><li> with <span> items to
represent a treeview of pages structure in a website.
The spans have an id attribute that I am using to load content from db
with ajax.
What I would like to do, is to permanently highlight the last item I
clicked on, so that I visually see which item I am working with (i.e.
editing content of the related page for instance).
I have succeeded in highlighting each clicked item, but cannot remove
the class once I click another one. Here is the small bit of code:
$("span[@id*=id]").click(function() {
//remove previously highlighted item [this does not seem to work]
$("*").removeClass("highligh");
//highlight clicked item [this works ok]
$(this).addClass("highlight");
});
Any ideas?
Thanks!