<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<input type="range" onchange="cg(this);" id="input1"/><br><br><br><br>
<div id="div1" style="background:red;width:100px;height:100px;"></div>
<script type="text/javascript">
(function(obj){
obj.addEventListener("mousedown",function(){
obj.addEventListener("mouseout",function(){
this.removeEventListener("mousemove");
});
obj.addEventListener("mouseup",function(){
this.removeEventListener("mousemove");
});
obj.addEventListener("mousemove",function(){
document.getElementById("div1").style.transform="rotate("+this.value+"deg)";
});
});
})(document.getElementById("input1"));
</script>
</body>
</html>
此为好友分享的在此感谢