字符串为html,有图片的时候会闪,可以看下视频文件
MaYiFanGitHub opened this issue · 1 comments
MaYiFanGitHub commented
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<span class="box"></span>
</body>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.12"></script>
<script>
var typed = new Typed(".box", {
strings: [`<img width="90px" height="90px" src="https://appcms.cdn.bcebos.com/appcms/2022-04/3121c0b3e65eba016b704d54f1e6684a.png"/><br/><span>欢迎来到我的博客</span>123123<br/>`],//输出的文字
typeSpeed: 200,//打字的速度
});
</script>
</html>
123.mov
mattboldt commented
I'm not sure why the flashing is occurring, but I don't recommend using typedjs to display images since that can be confusing to the user. I recommend putting the image html separately, and then rendering the typing animation for text below it. I'm going to try to use google to translate this text into Chinese, so I apologize if there are errors.
我不确定为什么会出现闪烁,但我不建议使用 typedjs 来显示图像,因为这会让用户感到困惑。 我建议将图像 html 单独放置,然后在其下方渲染文本的打字动画。 我将尝试使用谷歌将这段文字翻译成中文,所以如果有错误,我深表歉意。