You might also be able to reduce this a bit, depending on your markup:

$('a.selected').parents('div.linkSubMenu').show();

It seems a shame to traverse all the way down that set of nodes, only to have to traverse back up.


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Mar 28, 2007, at 5:06 PM, Alexandre Plennevaux wrote:

in fact i just found a way:

$("div.linkSubMenu ul li a.selected").parent().parent().parent ().show();

is that the correct way? It seems a bit slow on rendering it.

From: [EMAIL PROTECTED] [mailto:discuss- [EMAIL PROTECTED] On Behalf Of Alexandre Plennevaux
Sent: mercredi 28 mars 2007 21:31
To: 'jQuery Discussion'
Subject: [jQuery] Selector question

hello !

i have a menu which structure for each item is:
(1)  ul > li > div.linkSubMenu > ul.detailSubnav>li>a

except for the selected menu, which is:

(2)  ul > li > div.linkSubMenu > ul.detailSubnav>li>a.selected


on load, all div.linkSubMenu are hidden (via css: display:none)

i would like that the selected one (2) be shown. I don't know how to target it via jquery, can you help me out?

thank you!

alex



Alexandre Plennevaux - LAb[au] asbl.vzw / MediaRuimte
Lakensestraat/Rue de Laeken 104
B-1000 Brussel-Bruxelles-Brussels
Belgie-Belgique-Belgium

Tel:+32(0)2.219.65.55
Fax:+32(0)2.426.69.86
Mobile:+32(0)476.23.21.42
http://www.lab-au.com
http://www.mediaruimte.be

______________________________________________________________________ ____

The information in this e-mail is intended only for the addressee named above. If you are not that addressee, please note that any disclosure, distribution or copying of this e-mail is prohibited. Because e-mail can be electronically altered, the integrity of this communication cannot be guaranteed.

______________________________________________________________________ ____



--
Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.448 / Base de données virus: 268.18.20/736 - Date: 27/03/2007 16:38


--
Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.448 / Base de données virus: 268.18.20/736 - Date: 27/03/2007 16:38

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to