包裹
为所有分割元素添加一个额外的包裹元素,并设置指定的 CSS overflow
属性。
输出
<span style="overflow: clip; display: inline-block;">
<span style="display: inline-block;">word</span>
</span>
接受
'hidden'
|'clip'
|'visible'
|'scroll'
|'auto'
- 布尔值(
true
等同于'clip'
) null
默认值
null
包裹代码示例
import { animate, stagger, text } from 'animejs';
const { chars } = text.split('p', {
chars: { wrap: true },
});
animate(chars, {
y: ['75%', '0%'],
duration: 750,
ease: 'out(3)',
delay: stagger(50),
loop: true,
alternate: true,
});
<div class="large centered row">
<p class="text-xl">Split and wrap text.</p>
</div>
<div class="small row"></div>