1
如果我有jQuery的:行程并选择第一要素的孩子sibilings类
<span class="test1"><span class="first">first</span></span>
<span class="test1">lorem</span>
<span class="test1">lorem</span>
<span class="test1">lorem</span>
<span class="test2"><span class="first">first</span></span>
<span class="test2">lorem</span>
我怎么只能选择.test1 .first
,任何徘徊,只有那些.test1
元素?
如果以此为test2的悬停功能不起作用,或者如果有任何元素都在测试1跨越之前。兄弟姐妹(':first')将不符合正确的要素。 – daxnitro 2012-02-13 01:43:33
该问题指定它应该只在“悬停任何且仅有那些.test1元素时”才起作用。至于选择其他兄弟姐妹的孩子,从所希望的问题中也不清楚:“兄弟姐妹班的第一个元素的孩子”。 – 2012-02-13 01:47:03