Sorry Ricardo but you say the problem is the dt element? With this markup I can do what I need in terms of css
With the css I put the divs inside the dt element to put a label, the icon and the other div to switch between visible/non visible dd How do you think I could put my markup to avoid this problem? I don't like your suggest because one of the main reasons to change from prototype to jquery was the css's selectors and they power I thinks this is a jquery's bug, isn't it? On 2 feb, 10:02, Ricardo Tomasi <ricardob...@gmail.com> wrote: > Ah that's quite confusing mark-up. A <dt> element can only contain > inline elements, certainly not divs and other definition lists. Nested > definition lists make no sense! I couldn't find the problem. > > Try $(this).parents('dl').slice(1) or $(this).parents('dl').slice > (0,-1), that will probably work. > > cheers, > - ricardo > > On Feb 1, 10:57 pm,Garito<gar...@gmail.com> wrote: > > > Gracias, Ricardo! > > I change the code with the complete test case for my issue > > > Sorry for the identation but the original code is generated and I copy/ > > paste with firebug > > > If I'm not wrong, with the selector 'dl:not(:last)' SITE dl is > > incorrect in the returned list because is the last dl (if not 'dl' > > will be equal to 'dl:not(:last)') > > > am I confused or there is a bug? > > > Thanks! > > > On 1 feb, 21:07, Ricardo Tomasi <ricardob...@gmail.com> wrote: > > > >http://jquery.nodnod.net/cases/85 > > > > Parece ok aqui. Pode ser alguma outra coisa na tua página, não dá pra > > > saber sem ver o html. > > > -------- > > > Seems to work fine here. Could you post a complete test page showing > > > this issue? > > > > - ricardo > > > > On Feb 1, 1:25 pm,Garito<gar...@gmail.com> wrote: > > > > > Hi! > > > > Please, consider this code: > > > > > $.fn.url2 = function(absoluta) { > > > > var slots = > > > > $(this).parents('dl:not(:last)').map(function() { > > > > return $(".Texto:first", $(this)).text(); > > > > }); > > > > var slots2 = $(this).parents('dl').map(function() { > > > > return $(".Texto:first", $(this)).text(); > > > > }); > > > > return slots.get().join("/") + ' -- ' + > > > > slots2.get().join("/"); > > > > }; > > > > > The funny thing of this code is that slots and slots2 have the same > > > > items > > > > Could you point me why slots put the last dl? > > > > > I suppose that dl:not(:last) retrieves all the parents except the last > > > > one but this don't work > > > > > Thanks!