我添加了loop: true
以重复该步骤,但是在完成一轮操作后,它将删除整个文本。
我只希望它只在相信之后删除文本
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css"></style>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9"></script>
<!-- <script src="typed.js"></script> -->
<style type="text/css">
#typed {
font-size: 50px;
display: inline-block;
}
.typed-cursor {
font-size: 50px;
}
.container {
background-image: url("https://i.imgur.com/sduLRvf.jpg");
background-size: cover;
height: 100vh;
}
</style>
</head>
<body>
<div class="container" style="background: #e2e2e2;" >
<div id="typed-strings">
<h1>We Believe in kdskdkcxkc</h1>
<h1>We Believe in dsfdsfsfewo</h1>
</div>
<span id="typed"></span>
</div>
<script>
var typed = new Typed('#typed', {
stringsElement: '#typed-strings',
typeSpeed: 50,
backSpeed: 20,
loop: true,
});
</script>
</body>
</html>