<!--- 界面效果做到了 但函数还是在执行中--->
<HTML>
<HEAD>
<script language="javascript">
var secs = 20; //倒计时的秒数
var URL ="http://mzsts.host3v.com" ;
function Load(){
for(var i=secs;i>=0;i--)
{
window.setTimeout('doUpdate(' + i + ')', (secs-i) * 1000);
}
}
function doUpdate(num)
{
if(secs>0)
{document.getElementById('ShowDiv').innerHTML = '将在'+num+'秒后自动跳转到主页' ;
if(num == 0) { window.location =URL; }
}
}
function timefun(){
secs =-1;
}
</script>
</HEAD>
<body onload="Load()" style="text-align:center;">
<canvas id="myCanvas" width="50px" height="50px" style="border: 1px solid red;">
</canvas>
<canvas id="myCanvas2" width="180px" height="50px" style="border: 1px solid red;">
</canvas>
<script type="text/javascript">
<!-- 1 -->
var canvas = document.getElementById("myCanvas");
if(canvas.getContext){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = "blue";
var circle = { 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 -->
var canvas = document.getElementById("myCanvas");
if(canvas.getContext){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = "blue";
var circle = { x : 25, y : 26, r : 10 };ctx.arc(circle.x, circle.y, circle.r, -Math.PI/2, Math.PI/4, true); ctx.stroke();
}
<!-- 3-->
var canvas = document.getElementById("myCanvas");
if(canvas.getContext){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = "red";
var circle = { 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 -->
var canvas = document.getElementById("myCanvas");
if(canvas.getContext){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = "red";
var circle = { x :45, y : 23, r : 10 };ctx.arc(circle.x, circle.y, circle.r, -Math.PI/2, Math.PI/4, true); ctx.stroke();
}
var canvas = document.getElementById("myCanvas2");
if(canvas.getContext){
var ctx = canvas.getContext("2d");
ctx.font = "10px Courier New";
ctx.fillStyle = "blue";
ctx.fillText("文洲 的个人主页,彼岸", 10, 20);
ctx.fillText("http://mzsts.host3v.com", 10, 40);
}
</script>
<div id="ShowDiv"> </div>
</br>
<button onclick="timefun()">点击延时</button>
<button onclick="window.open('http://mzsts.host3v.com')">直接跳转</button>
</br> </br>
<textarea rows="5" cols="40">
<body onload="Load('http://mzsts.host3v.com')">
<body onload="Load('http:www.baidu.com')">
</textarea>
</body>
</HTML>小代码 html 自己网页倒计时跳转
原创
©著作权归作者所有:来自51CTO博客作者wzdouban的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:备份一个自己网页
下一篇:小代码 学习 万年历综合版本
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
html JavaScript js倒计时跳转页面
[code="html"] var secs =5; //倒计时的秒数 var URL ; function Load(url){ URL =url; for
HTML JavaScript Blog ViewUI javascript -
倒计时Html javaScript
[code="html"]cha0距离2011年6月2日还有: [/code
HTML JavaScript ViewUI Math html -
php js倒计时代码(倒计时代码
刷新
html ide php -
JS倒计时网页自动跳转代码
JS倒计时网页自动跳转代码标签:倒计时自动跳转 时间:2013-06-12 已阅读:8607用JS实现网页上的自动跳转功能,倒计时
自动跳转 javascript html 百度 -
倒计时jquery代码 jquery 倒计时
倒计时jquery代码 jquery 倒计时
html Math ajax
















