【发布时间】:2016-09-24 19:43:35
【问题描述】:
我使用 waypoints.js 和 animate.css 作为这个例子:http://miguelmanchego.com/samples/2014/jquery-mostrar-animaciones.htm 在滚动时添加动画。
如果我有结构:
<div class="FlyWithMe">
<div>I am a bird!</div>
<div>Mee too!</div>
</div>
我当然可以用:
$('.FlyWithMe').waypoint(function() {
$(this).toggleClass( 'bounceIn animated' );
}
但是如何定义子元素而不是容器来为它们设置动画呢?
$('.FlyWithMe').waypoint(function() {
$(this>child).toggleClass( 'bounceIn animated' );
}
当然,我可以直接将类添加到子元素,但这只是一个更复杂情况的示例。
【问题讨论】:
-
哦,让我看看。
标签: javascript jquery