javascript教程:javascript网页标题闪烁特效设置方法
<!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=utf-8" />
<title>我的文档</title>
<script type="text/javascript" language="javascript">
Flicker() ;
var title = document.getElementsByTagName("title") ;
var title_txt = title[0].firstChild.nodeValue ;
var show = "【新消息】"+title_txt ;
var none = "【】"+title_txt ;
var i = 0 ;
< br />
function Flicker () {
setInterval("Change()",1000)
}
function Change () {
if(i==0) {
title[0].firstChild.nodeValue = show ;
i = 1 ;
}
else {
title[0].firstChild.nodeValue = none ;
i = 0 ;
}
}
</script>
</head>
<body>
</body>
</html>
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |