Sorry: i posted this in the main mailinglist: it occurs to me the dev
list might be more suited. Can you confirm this is a 1.2.6 bug fixed
in 1.3 beta 2? This is just so that i can tick this in my own app's
bugs list.
Thank you Alexandre


---------- Forwarded message ----------
From: pixeline <aplennev...@gmail.com>
Date: Tue, Jan 6, 2009 at 4:18 PM
Subject: [jQuery] a possible selector bug in 1.2.6 solved in 1.3.beta2
To: "jQuery (English)" <jquery...@googlegroups.com>



strange, i was fighting against a bit of code where the selector
engine would not want to behave as i expected.
Out of ideas, i tried using the freshly released jquery 1.3 beta 2 and
it turns out the engine now works as i expected!

here is the incriminated code:

var $thisLI = $('#' + UI.section);
if ($thisLI.length > 0)
 {
                       var $thisMenu = $thisLI.parent();
                       var $thisA = $('a:first', $thisLI);
                       $('a.selected', $thisMenu).removeClass
('selected');
                       $thisA.addClass('selected');
                       var liIndex = $thisMenu.children('li').index
($thisLI[0]);
                       var newleft = 0 - (strataGrid.colWidth *
(liIndex + 1));
                       $thisLI.siblings().removeClass
('selected').addClass('notSelected');
                       $thisMenu.animate({ left: newleft }, 'slow',
function()
                       {
                           // this takes care of show/hiding menus
and submenus
                           $thisA.parents('li').removeClass
('notSelected').addClass('selected');
        });
}
I think the culprit is

$thisLI.siblings().removeClass('selected').addClass('notSelected');

as the modified DOM shows the "selected" class also in children LI's
inside that UL branch,

you can view it live here:
(click on "news")
http://www.pixeline.be/test/metalab/prototype/

and working correctly
http://www.pixeline.be/test/metalab/prototype/index_1.6b2.htm

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to