我试图找到<span class ="anime_yellow">..
另一个里面的每一个<span class="toggle">
,这是代码:
HTML:
<span class="title_white">Menu 1</span>
<span class="toggle">
this is menu 1 i want to animate
<span id="position" class="anime_yellow">Position</span>
and
<span id ="market" class="anime_yellow">market</span>.
</span>
<br><br>
<span class="title_white">Menu 2</span>
<span class="toggle">
this is menu 2 i want to animate
<span id="simple" class="anime_yellow">Simple</span>
and
<span id ="kool" class="anime_yellow">Kool</span>.
</span>
Javascript:
$(".toggle").hide();
$(".title_white").click(function() {
$(".toggle").hide();
$(this).next(".toggle").toggle("slow");
// i want to find every span.anime_yellow inside the
// THIS TOGGLE class and get its element ID
// and then run function on the ID
// animate(position) or animate(simple).
});
我试图使用 jquery 函数 .find(),但不知道从哪里开始,这是这里的 jsfiddle:http: //jsfiddle.net/wJJBa/2/