马一下,希望做个更好的
马一下,希望做个更好的
马一下,希望做个更好的
2015-01-30
<!DOCTYPE html>
<html>
<head>
<title>正方体</title>
<style>
.wrapper{
width:800px;
margin:100 auto 150px;
perspective:200px;
text-align:center;
transform-style:preserve-3d;
}
#wrap{
width:200px;
height:200px;
background-color:#ccc;
position:relative;
left:50%;
margin-left:-100px;
}
p{
margin-top:100px;
}
input{
width:400px;
}
</style>
<script>
function rotate(){
var z=document.getElementById("rota").value;
document.getElementById("zhi").innerText=z;
document.getElementById("wrap").style.webkitTransform="rotatez("+z+"deg)";
}
</script>
</head>
<body>
<div class="wrapper">
<div id="wrap">
</div>
<p>
<span id="zhi">0</span>deg<br>
<input type="range" min="-360" max="360" value="0" id="rota" onchange="rotate()">
</p>
</div>
</body>
</html>
举报