1个回答
展开全部
给你写个JavaScript脚本,放在网页中可以定时自动更改背景颜色!
代码给你贴出来。。。。
脚本说明:
第一步:将下面代码加到<body>与</body>之间
<script language="JavaScript">
var pos = 10;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
var col=new initArray("4b","5b","8b","8b");
col[0] = "white";
col[1] = "coral";
col[2] = "orange";
col[3] = "red";
col[4] = "greenyellow";
col[5] = "lime";
col[6] = "turquoise";
col[7] = "coral";
col[8] = "blueviolet";
col[9] = "violet";
function chgCol() {
pos++;
if (pos<0||pos>9) {
pos = 0;
}
document.bgColor = col[pos];
setTimeout("chgCol()",1000);
}
var yourwords = "";var buffer1=" ";
var buffer2=" ";
var message1=buffer1+yourwords+buffer2;
var dir = "left";var speed =150;
function pingpong(){if (dir == "left")
{ message2=message1.substring(2,message1.length)+" ";
window.status=message2;
setTimeout("pingpong();",speed);
message1=message2;
if (message1.substring(0,1) == "*") dir="right";
}
else
{ message2=" "+message1.substring(0,message1.length-2);
window.status=message2;
setTimeout("pingpong();",speed);
message1=message2;
if (message1.substring(message1.length-1,message1.length) == "*") dir="left";
}
}
</script>
第二步:将<body>替换成下面的代码
<body onLoad="chgCol(); pingpong();">
代码给你贴出来。。。。
脚本说明:
第一步:将下面代码加到<body>与</body>之间
<script language="JavaScript">
var pos = 10;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
var col=new initArray("4b","5b","8b","8b");
col[0] = "white";
col[1] = "coral";
col[2] = "orange";
col[3] = "red";
col[4] = "greenyellow";
col[5] = "lime";
col[6] = "turquoise";
col[7] = "coral";
col[8] = "blueviolet";
col[9] = "violet";
function chgCol() {
pos++;
if (pos<0||pos>9) {
pos = 0;
}
document.bgColor = col[pos];
setTimeout("chgCol()",1000);
}
var yourwords = "";var buffer1=" ";
var buffer2=" ";
var message1=buffer1+yourwords+buffer2;
var dir = "left";var speed =150;
function pingpong(){if (dir == "left")
{ message2=message1.substring(2,message1.length)+" ";
window.status=message2;
setTimeout("pingpong();",speed);
message1=message2;
if (message1.substring(0,1) == "*") dir="right";
}
else
{ message2=" "+message1.substring(0,message1.length-2);
window.status=message2;
setTimeout("pingpong();",speed);
message1=message2;
if (message1.substring(message1.length-1,message1.length) == "*") dir="left";
}
}
</script>
第二步:将<body>替换成下面的代码
<body onLoad="chgCol(); pingpong();">
参考资料: http://hi.baidu.com/gaolinlin0220
博思aippt
2024-07-20 广告
2024-07-20 广告
作为深圳市博思云创科技有限公司的工作人员,对于Word文档生成PPT的操作,我们有以下建议:1. 使用另存为功能:在Word中编辑完文档后,点击文件->另存为,选择PowerPoint演示文稿(*.pptx)格式,即可将文档内容转换为PPT...
点击进入详情页
本回答由博思aippt提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询