您好,登錄后才能下訂單哦!
<!--- 界面效果做到了 但函數還是在執行中---> <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()" > <canvas id="myCanvas" width="50px" height="50px" > </canvas> <canvas id="myCanvas2" width="180px" height="50px" > </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>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。