On 25/01/07, Blair McKenzie <[EMAIL PROTECTED]> wrote: > Try > $("#menu li.actif ~ li") > > Translation: > Find an element with id menu (id by itself is faster than id with tag), then > find a descendent LI with class actif, and return the preceding element if > it is a LI. > > Blair
$("#menu li.actif").prev("li") should work as well. > > > On 1/25/07, Stéphane Nahmani <[EMAIL PROTECTED]> wrote: > > 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 > > [EMAIL PROTECTED] > > http://www.sholby.net/ > > > > _______________________________________________ > > jQuery mailing list > > discuss@jquery.com > > http://jquery.com/discuss/ > > > > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/