一个JS函数搞定网页标题(title)闪动效果

内容摘要
复制代码 代码如下:<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title></head><body><script language="Jav
文章正文
复制代码 代码如下:

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>无标题文档</title>
</head>
<body>
<script language="JavaScript">
 step=0
 function flash_title()
 {
  step++
  if (step==3) {step=1}        
  if (step==1) {document.title='【你有新的消息】'}
  if (step==2) {document.title='【      】'}
  setTimeout("flash_title()",380);
 }
 flash_title()
</script>
aaaaaaddaaaaaa
</body>
</html>

代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!