Asp.net Title 标题闪烁的script

Asp.net Title 标题闪烁的script

 

Function 1.

<script>
var g_blinkswitch = 0;
var g_blinktitle = document.title;
function blinkNewMsg()
{

 document.title = g_blinkswitch % 2==0 ? "【   】 - " + g_blinktitle : "【新消息】 - " + g_blinktitle;
 g_blinkswitch++;

}

setInterval(blinkNewMsg, 1000);
</script>

 


Function 2.

 

<script language="javascript">
<!--
var tx = new Array (
"您好呀,欢迎您的光临^_^",
"知道吗?我就是标题栏",
"呵呵,现在我也~会闪啦",
"看啊,我闪~我闪……",
"快快把你的眉眼抛过来呀!嘻嘻……");
//设置好你的页面标题栏中要闪烁的5句文本(具体内容自己据需而定吧你)
var txcount=5;
//数字“5”对应于上边设定的文本数
var i=1;
var wo=0;
var ud=1;
//定义i、wo、ud三者的初值
function animatetitle()
{
window.document.title=tx[wo].substr(0, i)+"_";
if (ud==0) i--;
if (ud==1) i++;
if (i==-1) {ud=1;i=0;wo++;wo=wo%txcount;}
if (i==tx[wo].length+10) {ud=0;i=tx[wo].length;}
// if (window.document.title.length < 20 ) window.document.title=window.document.title+"-";
// if (window.document.title.length == 20 ) window.document.title=window.document.title+"]";
// if (window.document.title.length == 21 ) setTimeout("window.document.title='Animierte Seitentitel '; ",1000);

parent.window.document.title=tx[wo].substr(0, i)+"_";
setTimeout("animatetitle()",100); //数字“100”指每一字符闪烁速度为100毫秒,其改大(小)就闪的慢(快),可自行设置数值
}
//以上几行是对标题栏(title)的function为animatetitle的控制过程
animatetitle();
//标题栏(title)中运行animatetitle
// -->
</script>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值