让一个新元素出现在 SVG.js 动画时间轴的中间

发布于 2025-01-12 19:16:07 字数 211 浏览 1 评论 0原文

我有一个 SVG.js 动画时间轴,希望一些文本出现 5 秒。我想也许我可以这样做:

var popup = draw.text('Here is my text').attr({x:250, y:225 }).hide();
popup.animate(0, 5000).show();

hide() 有效,但 show() 不是动画方法。

I have a SVG.js animation timeline and want some text to appear 5 seconds in. I thought maybe I could do:

var popup = draw.text('Here is my text').attr({x:250, y:225 }).hide();
popup.animate(0, 5000).show();

The hide() works, but show() isn't an animation method.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烏雲後面有陽光 2025-01-19 19:16:07

使用 attr() 尝试设置初始 opacity: 0 并将其更改为 opacity: 1

popup.animate(0, 5000).attr({ opacity: 1 });

我不认为 hide 或 show 是库方法

with attr() try setting the initial opacity: 0 and changing it to opacity: 1

popup.animate(0, 5000).attr({ opacity: 1 });

I don't think either hide or show are library methods

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文