网页设计文字动态编写

来源:百度知道 编辑:UC知道 时间:2024/09/22 08:34:35
网页设计文字动态编写为什么点chang没反应啊?我已经解除阻止了啊.
下面是:
<html>
<head>
<style type="text/css">
.wordstyle1{
font-family:fantasy
font-size:20pt
font-weight:500
font-variant:normal
font-style:italic
color:blue
background-color:yellow
}
.wordstyle2{
font-family:verdana
font-size:26pt
font-weight:700
font-variant:small-caps
font-style:normal
color:white
background-color:blue
}
.wordstyle3{
font-family:cursive
font-size:32pt
font-weight:900
font-variant:small-caps
font-style:bold
color:yellow
background-color:green
}
</style>
<script language="JScript">
var n,i=0
function chang () {
i=i+1
n=i%3
if(n==1) id1.className="wordstyle1"
else if (n==2) id1.className="wordstyle2"
else id1.className="wordstyle3"
}
</script>

函数名称写错了,点击时调用change(),函数名写成了chang()
在样式表里每一句都要用分号(;)隔开,在wordstyle1,wordstyle2,wordstyle3的所有样式后面都加分号
改正后是这样的:
<html>
<head>
<style type="text/css">
.wordstyle1{
font-family:fantasy
font-size:20pt
font-weight:500
font-variant:normal
font-style:italic
color:blue
background-color:yellow
}
.wordstyle2{
font-family:verdana;
font-size:26pt;
font-weight:700;
font-variant:small-caps;
font-style:normal;
color:white;
background-color:blue;
}
.wordstyle3{
font-family:cursive;
font-size:32pt;
font-weight:900;
font-variant:small-caps;
font-style:bold;
color:yellow;
background-color:green;
}
</style>
<script language="JScript">
var n,i=0
function change () {
i=i+1
n=i%3
if(n==1) id1.className="wordstyle1"
else if (n==2) id1.className="