Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-bocchi authored Nov 5, 2024
1 parent 5c64e12 commit e45062b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ box存的是图片坐标,calcX是要沿x轴旋转角度,calcY是要沿y轴

angle = 鼠标相对坐标 / Sensitivity,Sensitivity越小,转动角度越大

调用requestAnimationFrame()

requestAnimationFrame函数用于动画渲染,类似间隔器,大概1秒调用60次回调函数,当然具体原理肯定不是这样的,但效果就是使动画效果有平滑感,不会出现卡顿。

```js
window.requestAnimationFrame(回调函数(即要调用的函数))
```



##### 2.设定监听事件

移入事件
Expand Down

0 comments on commit e45062b

Please sign in to comment.