JS图片旋转

<html>
<script> var deg = 0; function rotate() { var ele=document.getElementById("img"); deg+=45; ele.style.transform="rotate("+deg+"deg)" } script>
<image id="img" src="test.png" > image>
<button onclick="rotate()">rotatebutton>
html>

转载于:https://my.oschina.net/tangzhichao/blog/781616

你可能感兴趣的:(JS图片旋转)