网页编程 - 精美的自动画图
<span id=adf></span> <SCRIPT LANGUAGE="JavaScript"> <!-- var t=0,n=null,speed=30; function go(){ if(t<360){ t++; }else{clearTimeout(n);return false;} lo=200 * Math.sin(2 * (Math.PI / 180) * t); x = lo * Math.cos((Math.PI / 180) * t); y = lo * Math.sin((Math.PI / 180) * t); a(x,y,"#000000"); lo=200 * Math.cos(2 * (Math.PI / 180) * t); x = lo * Math.cos((Math.PI / 180) * t); y = lo * Math.sin((Math.PI / 180) * t); a(x,y,"#ff0000"); adf.innerText=t; n=setTimeout('go()',speed); } function a(x,y,color){ /* document.body.innerHTML+="<img border='0' style='position: absolute; left: "+(x+300)+"; top: "+(y+200)+";background-color: "+color+"' src='images/logo.gif' width=20 height=10>"; */ pobj=document.createElement("IMG"); document.body.appendChild(pobj); with(pobj){ border=0; style.position='absolute'; style.pixelLeft=(x+300); style.pixelTop=(y+200); style.backgroundColor=color; style.pixelWidth=1; style.pixelHeight=1; } } window.onload=go; //--> </SCRIPT>
本站
说明
网页版
站长
简介
微博
日记
照片
同学
资料
文章
电脑
编程
维护
链接
功能
电话
短信
邮件
登录