浏览器闪动效果(标题+内容)

Posted on 2008-11-24 14:12 sky-v 阅读(542) 评论(0) 编辑 收藏

在网易博客上看到的标题闪动效果,感觉挺不错的。可以在有新消息时候浏览器闪动,假如有新消息时,触发flash_title方法,让标题闪动。

标题闪动效果代码:

<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<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>

</BODY></HTML>

 

 

内容闪动效果代码:

<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="author" content="">
<SCRIPT>
function blink (elId) {
var html = '';
if (document.all)
html += 'var el = document.all.' + elId + ';';
else if (document.getElementById)
html += 'var el = document.getElementById("' + elId + '");';
html +=
'el.style.visibility = ' +
'el.style.visibility == "hidden" ? "visible" : "hidden"';
if (document.all || document.getElementById)
setInterval(html, 500)
}
function init () {
blink('aText');
blink('a2ndText');
}
</SCRIPT>
<title>
<BLINK>
闪烁效果!!!
</BLINK>
</title>
</HEAD>
<BODY ONLOAD="init();">
<SPAN ID="aText">
<BLINK>
这行文字闪烁!!!
</BLINK>
</SPAN>
<BR>
这行文字闪烁!!!
<DIV ID="a2ndText">
这行文字闪烁!!!
</DIV>
</BODY>
</HTML>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值