[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Jeroen Coumans
You're right. I've adjusted my test case slightly and tested in more browsers. Apparently, Safari put me on the wrong track - it's the only browser that handles it the way I expected it to (and the only browser I checked in). Thanks a lot, this was a good learning experience for me! Jeroen On Au

[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Brandon Aaron
Whoops :) that should be: #test > li > a That will only select the direct a tags of the LI. Previously you where selecting all A tags of the LI. Even the A tags within the other child elements of the LI. -- Brandon Aaron On 8/29/07, Brandon Aaron <[EMAIL PROTECTED]> wrote: > > Actually it work

[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Brandon Aaron
Actually it works this way in the CSS Spec also and your test file proves it. Just use this selector instead of your other selector: #test > li a -- Brandon Aaron On 8/29/07, Jeroen Coumans <[EMAIL PROTECTED]> wrote: > > > Thanks for the explanation, that makes sense. But this is not how the > C

[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Jeroen Coumans
Thanks for the explanation, that makes sense. But this is not how the CSS spec has it defined. You can see that in my test file where the CSS rule is only applied to the top list items. The question is; is the jQuery behaviour a bug or a feature? And if it's a feature, it should be documented. J

[jQuery] Re: How do child selectors work in jQuery?

2007-08-29 Thread Brandon Aaron
Because you are binding the click event to the a tag, not the li. So what your saying is get all the a tags within each li (which is all the a tags in your ul). You just need one more child selector in there between the li and a to make sure you only select the immediate a tags of the li only ... i