87,904
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>我的星空</title>
<style type="text/css">
div {
position: absolute;
font-size: 35px;
color: yellow;
}
</style>
<script type="text/javascript">
function explorer() {
var stars = document.getElementsByTagName("div");
var count = 0;
for (var i = 0; i < stars.length; i++) {
var temp = stars[i];
temp.style.top = Math.random() * 500;
temp.style.left = Math.random() * 1000;
var st=temp.currentStyle?temp.currentStyle:getComputedStyle(temp,null);
alert(st.color);
/*if (count % 2 == 0) {
temp.style.color = #white;
} else {
temp.style.color = #ff0;
}*/
}
count++;
window.setTimeout("explorer()", 1000);
}
</script>
<link rel="stylesheet" type="text/css" href="" />
</head>
<body bgcolor="black" onload="explorer()">
<div>...</div>
</body>
</html>