跳过主要内容

终止应用于给定目标子元素的所有补间动画

你可以通过使用此函数来终止所有属于给定目标子元素的补间动画:

演示

function killChildTweensOf(ancestor) {
ancestor = gsap.utils.toArray(ancestor)[0];
gsap.globalTimeline
.getChildren(true, true, false)
.forEach((tween) =>
tween
.targets()
.forEach((e) => e.nodeType && ancestor.contains(e) && tween.kill(e))
);
}

加载中...

目录

无噪 Logo
无噪文档
中文文档 · 复刻官网
查看所有 ↗