circle.prototype.draw = function(){ this.angle +=this.speedAngle; this.setXY(); var f = document.getElementById("cd"); //$("body").append($("#cd").clone()); f.style.left =this.x+"px"; f.style.top = this.y+"px"; }
function timetable(){ var f = document.getElementById("daa"); var d = new Date(); f.innerHTML = "现在时间:"+d.getUTCFullYear()+"年"+d.getUTCMonth()+"月"+d.getUTCDate()+"日 星期"+d.getUTCDay()+" "+d.getUTCHours()+":"+d.getUTCMinutes()+":"+d.getUTCSeconds(); }
var lenstr = -1; function prints(){ var str = document.getElementById("sourse").innerHTML; if(lenstr<str.length){ lenstr++; var f = document.getElementById("prin"); //if(lenstr%100==0)f.innerHTML +="<br />"; f.innerHTML += str.charAt(lenstr); }else{ loop.deleteloop(prints); } }
var movediv = new moveLayer1(); function imgMove(){movediv.move();}
var mycircle = new circle(); function drawCircle(){mycircle.draw();}
function winInit(){ mycircle.init(); loop.setloop(drawCircle); loop.setloop(imgMove); loop.setloop(timetable); loop.setloop(prints); }
function Plus(a, b) { var z = 0; var i = 0; for (i = 0; i < arguments.length; i++) { z += arguments[i]; } setTimeout( function() {alert(z);}, 6000); //可以带变量参数的setTimeout调用形式 return z; }
setTimeout( function(){ sum = Plus(x, y, z); }, 3000); /*除了可以带变量参数还可以获取返回值的setTimeout调用形式*/ </div> </body> </html>