当前位置:首页 > 设计在线 > 网页设计 > Javascript > 页面背景花瓣效果

页面背景花瓣效果

点击次数:28 次 发布日期:2008-11-26 22:48:05 作者:源代码网
源代码网推荐

把如下代码加入<body>区域中:
<script Language="JavaScript">
function a(x,y,color)
{document.write("<img border="0" style="position: absolute; left: "+(x+300)+"; top: "+(y+200)+";background-color: "+color+"" src="http://www.blue1000.com/article/px.gif" width=1 height=1>")}
</script>
<script>

for(t=1;t<=360;t++){
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");
}
</script>


源代码网供稿.
网友评论 (0)
会员中心
设计在线
本站推荐
设计在线之精华