javascript如何使页面文字闪烁
程序员文章站
2022-07-14 22:05:32
...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="JavaScript">
n=false;
function flash(txtId){
n=!n;
(n)?(txtId.runtimeStyle.color='blue'):(txtId.runtimeStyle.color='red');
}
</script>
<script>
setInterval(function(){blink.color=blink.color=='#0000ff'?'red':'blue'},100)
</script>
</head>
<body>
<center><br />
<script language="JavaScript">setInterval('flash(blink0)',500)</script>
<font id="blink0" color="blue">闪烁1</font>
<script language="JavaScript">setInterval('flash(blink1)',500)</script>
<font id="blink1" color="blue">闪烁2</font>
<script language="JavaScript">setInterval('flash(blink2)',500)</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="JavaScript">
n=false;
function flash(txtId){
n=!n;
(n)?(txtId.runtimeStyle.color='blue'):(txtId.runtimeStyle.color='red');
}
</script>
<script>
setInterval(function(){blink.color=blink.color=='#0000ff'?'red':'blue'},100)
</script>
</head>
<body>
<center><br />
<script language="JavaScript">setInterval('flash(blink0)',500)</script>
<font id="blink0" color="blue">闪烁1</font>
<script language="JavaScript">setInterval('flash(blink1)',500)</script>
<font id="blink1" color="blue">闪烁2</font>
<script language="JavaScript">setInterval('flash(blink2)',500)</script>
</body>
</html>
上一篇: 关于Lucene搜索中查询器 PhraseQuery 的解释
下一篇: 数据压缩实验五:JPEG解码