让标题栏文字循环变化
======= 例子一 ===================================
1.在<head></head>中加入下列代码。
<script language="JavaScript">
var msg = "大量大量的实用经验,请访问YC网盟网友制作";
var speed = 300;
var msgud = " " + msg;
function titleScroll() {
if (msgud.length <msg.length) msgud += " - " + msg;
msgud = msgud.substring(1, msgud.length);
document.title = msgud.substring(0, msg.length);
window.setTimeout("titleScroll()", speed);
}
</script>
2.在<body>中加入下列代码。
onload="window.setTimeout(''titleScroll()'', 500)"
======= 例子二 =================================
<html>
<head>
<title>改变窗体的标题 风越ASP代码生成器</title>
</head>
<script language="VBScript">
title="Change Window Title. "
l=len(title)
i=l-1
sub move()
mess=right(title,l-i)+left(title,i)
top.document.title=mess
i=(i+1) mod l
end sub
</script>
<script language="JavaScript">
a=setInterval("move()",100);
</script>
<body>
</body>
</html>
======= 例子一 ===================================
1.在<head></head>中加入下列代码。
<script language="JavaScript">
var msg = "大量大量的实用经验,请访问YC网盟网友制作";
var speed = 300;
var msgud = " " + msg;
function titleScroll() {
if (msgud.length <msg.length) msgud += " - " + msg;
msgud = msgud.substring(1, msgud.length);
document.title = msgud.substring(0, msg.length);
window.setTimeout("titleScroll()", speed);
}
</script>
2.在<body>中加入下列代码。
onload="window.setTimeout(''titleScroll()'', 500)"
======= 例子二 =================================
<html>
<head>
<title>改变窗体的标题 风越ASP代码生成器</title>
</head>
<script language="VBScript">
title="Change Window Title. "
l=len(title)
i=l-1
sub move()
mess=right(title,l-i)+left(title,i)
top.document.title=mess
i=(i+1) mod l
end sub
</script>
<script language="JavaScript">
a=setInterval("move()",100);
</script>
<body>
</body>
</html>
本文转自94cool博客园博客,原文链接http://www.cnblogs.com/94cool/archive/2009/09/22/1571672.html,如需转载请自行联系原作者