html5 canvas寫一個圖片圍繞圖片中心一直旋轉的代碼,用translate和rotate方法
4 回答
慕森王
TA貢獻1777條經驗 獲得超3個贊
你只要將div換成img就行了
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
div{
width: 200px;
height: 200px;
background: yellow;
animation:myfirst 5s linear 2s infinite alternate;
-webkit-animation:myfirst 5s linear 0s infinite normal;
-moz-animation: myfirst 5s linear 0s infinite normal;
-o-animation: myfirst 5s linear 0s infinite normal;
}
@keyframes myfirst{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div style=""></div>
</body>
</html>
- 4 回答
- 0 關注
- 700 瀏覽
添加回答
舉報
0/150
提交
取消
