target:nth-child(n)
CSS permite selecionar todos os enésimos elementos com a classe de destino ou tipo de elemento. Veja como você daria ao terceiro elemento em cada poço a classe de rejeição: $(".target:nth-child(3)").addClass("animated bounce");
Faça o segundo filho em cada um dos seus elementos do poço saltar. Você deve selecionar os filhos dos elementos com a classe de target
. target
deve saltar.
testString: 'assert($(".target:nth-child(2)").hasClass("animated") && $(".target:nth-child(2)").hasClass("bounce"), "The second element in your target
elements should bounce.");'
- text: Apenas dois elementos devem saltar.
testString: 'assert($(".animated.bounce").length === 2, "Only two elements should bounce.");'
- text: 'Você deve usar o seletor :nth-child()
para modificar esses elementos.'
testString: 'assert(code.match(/\:nth-child\(/g), "You should use the :nth-child()
selector to modify these elements.");'
- text: Use apenas o jQuery para adicionar essas classes ao elemento.
testString: 'assert(code.match(/\$\(".target:nth-child\(2\)"\)/g) || code.match(/\$\(".target:nth-child\(2\)"\)/g) || code.match(/\$\(".target"\).filter\(":nth-child\(2\)"\)/g) || code.match(/\$\(".target"\).filter\(":nth-child\(2\)"\)/g), "Only use jQuery to add these classes to the element.");'
```