小代码 html 自己网页倒计时跳转
<!---界面效果做到了但函数还是在执行中---><HTML><HEAD><scriptlanguage="javascript">varsecs=20;//倒计时的秒数varURL="http://mzsts.host3v.com";functionLoad(){for(vari=secs;i>=0;i--){window.setTimeout('doUpdate('+i+')',(secs-i)*1000);}}functiondoUpdate(num){if(secs>0){document.getElementById('ShowDiv').innerHTML='将在'+num+'秒后自动跳转到主页';if(num==0){window.location=URL;}}}functiontimefun(){secs=-1;}</script></HEAD><bodyonload="Load()"><canvasid="myCanvas"width="50px"height="50px"></canvas><canvasid="myCanvas2"width="180px"height="50px"></canvas><scripttype="text/javascript"><!--1-->varcanvas=document.getElementById("myCanvas");if(canvas.getContext){varctx=canvas.getContext("2d");ctx.beginPath();ctx.strokeStyle="blue";varcircle={x:10,y:40,r:10};ctx.arc(circle.x,circle.y,circle.r,-Math.PI*3/4,Math.PI/2,false);ctx.stroke();}<!--2-->varcanvas=document.getElementById("myCanvas");if(canvas.getContext){varctx=canvas.getContext("2d");ctx.beginPath();ctx.strokeStyle="blue";varcircle={x:25,y:26,r:10};ctx.arc(circle.x,circle.y,circle.r,-Math.PI/2,Math.PI/4,true);ctx.stroke();}<!--3-->varcanvas=document.getElementById("myCanvas");if(canvas.getContext){varctx=canvas.getContext("2d");ctx.beginPath();ctx.strokeStyle="red";varcircle={x:30,y:35,r:10};ctx.arc(circle.x,circle.y,circle.r,-Math.PI*3/4,Math.PI/2,false);ctx.stroke();}<!--4-->varcanvas=document.getElementById("myCanvas");if(canvas.getContext){varctx=canvas.getContext("2d");ctx.beginPath();ctx.strokeStyle="red";varcircle={x:45,y:23,r:10};ctx.arc(circle.x,circle.y,circle.r,-Math.PI/2,Math.PI/4,true);ctx.stroke();}varcanvas=document.getElementById("myCanvas2");if(canvas.getContext){varctx=canvas.getContext("2d");ctx.font="10pxCourierNew";ctx.fillStyle="blue";ctx.fillText("文洲的个人主页,彼岸",10,20);ctx.fillText("http://mzsts.host3v.com",10,40);}</script> <divid="ShowDiv"></div></br><buttononclick="timefun()">点击延时</button><buttononclick="window.open('http://mzsts.host3v.com')">直接跳转</button></br></br><textarearows="5"cols="40"><bodyonload="Load('http://mzsts.host3v.com')"><bodyonload="Load('http:www.baidu.com')"></textarea></body></HTML>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。