动画的目标对象(targets)
CSS选择器
可使用任意CSS选择器作为动画目标
不可使用伪元素
Type | Default | Example |
String | null |
targets: '.item' |
DOM元素 /元素序列
使用DOM节点或节点的集合作为动画目标
Type | Default | Example |
DOM Node | null |
targets: el.querySelector('.item') |
NodeList | null |
targets: el.querySelectorAll('.item') |
Javascript对象
以JavaScript对象作为动画目标,这个对象必须含有至少一个数字属性。
Type | Default | Example |
Object | null |
targets: myObjectProp |
{"charged":"0%","cycles":120}
数组
以数组作为动画目标。
Accepts mixed types. E.g. ['.el', domNode, jsObject]
Type | Default | Example |
Array | null |
targets: ['.item', el.getElementById('#thing')] |