javascript实现广告浮动效果

<html>
<head>
<script language="JavaScript">
function Move()
{
document.getElementById("Layer1").style.left=Math.random()*1024;
document.getElementById("Layer1").style.top=Math.random()*768;
setTimeout("Move()",800);//每隔800毫秒调用此函数
}
</script>
</head>
<body onLoad="Move()">
<div id="Layer1" style="position:absolute;left:14px;top:44px;width:150px;height:102px;z-index:1">
<a href="http://www.baidu.com/" ><img src="D:\My Documents\杨小运(09105024).jpg" width="150" height="100">
</a>
</div>

<h2>随机漂浮广告</h2>
</body>
</html>

posted @ 2009-09-24 21:49  luck_net  阅读(406)  评论(0编辑  收藏  举报