<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>送给我们亲爱的____老师</title>
<embed src="Meeting.mp3" hidden="true" autostart="true" loop="true">
</head>
<style >
div{
margin-left: 60px;
margin-top: 70px;
margin-right: 60px;
margin-bottom: 50px;
width: 1250px;
height: 100px;
border:1px
solid #FFFFFF00;
font-size: 40px;
font-family: "Comic Sans MS";
color: #000000;
}
</style>
<body>
<body background="Background.jpg"
style="background-repeat: no-repeat;
background-size: 100%;
background-attachment: fixed;">
<div id = "test"></div>
<script >
//用#代替换行,用$代替空格
var text = "Dear Mrs.Ma,# $ $ I'm sorry to hear that you won't teach us next term. But the memory between you and us has already deepen in my mind. # $ $ In the early lessons you taught us, I thought you are a classy teacher. A few weeks later, I found you are also a skillful teacher. Your teaching methods are so extraordinary that I have made a wonderful progress just less than one year. It's responsible to you for correcting our writing practice homework and writing down your advice on everyone's paper. Besides, you are a rich idea teacher. The punishment that let the lazy students perform in front of the whole class is excellent! You are our friend more than our teacher. When we play a joke on your Chinese pronunciation, you'll blame us with smile. When you called yourself “microphone master”, we thought “What a cute teacher you are!” # $ $ I'll continue to study hard in English and live up to your expectations. Hope you can get along well with your new students. Please don't forget us! Love you!# $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ Your sincere students. ";
var context="";
var num = text.length;
var i =0;
function show() {
if(text[i] == "#"){
context += "
";
}else if(text[i] == "$"){
context += " ";
}else{
context += text[i];
}
document.getElementById("test").innerHTML = context;
i++;
if(i + 1 >= num){
clearInterval("done");
}
}
var done=setInterval("show()",10);
</script>
</body>
</html>
求看一下为什么最后Undefined一直报错啊?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-