***页面特效***不停变换的按钮,当然链接也是随之变化的
把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件要完成此效果有三个步骤
第一步:把如下代码加入到<head>区域中
<script language="javascript">
<!-- begin
// please help yourself to this code.
var starttime =null;
var timerid =null;
var initial =new date();
var pos =0;
var menuitem =null;
function initarray() {
this.length = initarray.arguments.length
for (var i = 0; i < this.length; i++) {
this = initarray.arguments
}
}
function parsemenuitem(data,num) {
for(var i=0;i<data.length;i++){
if(data.substring(i,i+1)=="|")break;
}
if (num==0) return(data.substring(0,i));
elsereturn(data.substring(i+1,data.length));
}
function starttimer() {
initial = new date();
starttime=initial.gettime();
stoptimer();
menuitem = new initarray("netscape|http://www.netscape.com",
"microsoft|http://www.microsoft.com",
"ibm|http://www.ibm.com",
"yahoo|http://www.yahoo.com",
"excite|http://www.excite.com",
"hotbot|http://www.hotbot.com",
"typhoon start|http://typhoon.500.to",
"email|mailto:jojoo@jojoo.net"
);
showtimer();
}
function stoptimer() {
timerid=null;
menuitem=null;
//cleartimeout(timerid);
}
function showtimer() {
pos= (pos == menuitem.length) ? 1 : pos + 1;
document.forms.elements.value=parsemenuitem(menuitem,0);
timerid=window.settimeout('showtimer()',4000);
}
function gotourl(){
//parent.welcome.location=parsemenuitem(menuitem,1);
this.location=parsemenuitem(menuitem,1);
return (false);
}
// end -->
</script>
第二步:把如下代码加入到<body>区域中
<form>
<div align="center">
<input type="button" value="where to? "name="goto"
onclick="window.gotourl()">
</div>
</form>
第三步:把“onload="window.starttimer()"”加在<body>标记里
例如:<body onload="window.starttimer()">
--------------- ------------ -----------
拥有 三人行 论坛管理系列软件,一个人就可 以管理一个论坛的更新维护。还能使您的 论坛有千人在线的真实火暴效果, 让您不在为论坛因没有人气而留不住 会员而烦恼,使您的论坛早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。 (您 使用的是免费版本,购买收费版本后,将不带广 告。业务QQ : 247216 44985227 )
页:
[1]