1.感觉可以做一个很不错的进入界面。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
.box{width:200px;height:200px;border:1px solid #2FD000;margin:300px auto;}
</style>
<script>
window.onload=function(){
var b1=document.getElementsByClassName("box")[0];
var angle=0;
setInterval(function(){
angle++;
setCss3(b1,{"transform":"rotate("+angle+"deg)","transform-origin":"0 0"});
},1);
}
function setCss3(obj,attrObj){
for(var i in attrObj){
var newi=i;
if(newi.indexOf("-")>0){
var num=newi.indexOf("-");
newi=newi.replace(newi.substr(num,2),newi.substr(num+1,1).toUpperCase());
}
obj.style[newi]=attrObj[i];
newi=newi.replace(newi.charAt(0),newi.charAt(0).toUpperCase());
obj.style["webkit"+newi]=attrObj[i];
obj.style["moz"+newi]=attrObj[i];
obj.style["o"+newi]=attrObj[i];
obj.style["ms"+newi]=attrObj[i];
}
}
</script>
</head>
<body>
<div class="box"></div>
</body>
</html>