[jQuery] preceding sibling
Hello again,
I have written a simple menu in the most basic way i could: just an unordered
list, with only the active tab getting a class="active".
I am adding the correct styles to the first and last tabs with the :first and
:last selector. Works just fine.
The last thing i need is to be able to identify the tab that comes before the
active tab, if any. I have tried the axis selector for the preceding sibling
shown in the doc : $("//div ~ form")
However, that syntax is a bit foreign to me, and it unsurprisingly did not work
when i adpated it like this :
$("//ul#menu li ~ .actif").addClass("preactif");
(To be more precise, i want to select the "ul#menu li" that comes right before
the "ul#menu li.actif").
I have tried various combinations, but to no avail.
Help most welcome as always. Thanks!
--
Stéphane Nahmani / sholby
sholby@free.fr
http://www.sholby.net/
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/