知識點(diǎn)
鼠標(biāo)的事件
-
onmousedown()
鼠標(biāo)按下 -
onmousemove()
鼠標(biāo)移動 -
onmouseup()
鼠標(biāo)彈起
觸屏設(shè)備事件
-
ontouchstart
觸碰 -
ontouchmove
觸摸并移動 -
ontouchend
不觸碰
制作思路
- 畫一個
canvas
出來 - 定義監(jiān)聽函數(shù)掉蔬,在函數(shù)內(nèi)定義鼠標(biāo)以及觸屏事件,實(shí)現(xiàn)可以劃線
- 在阿里矢量圖庫尋找適合圖標(biāo)警儒,放入畫布
- 為對應(yīng)圖標(biāo)添加onclick事件竿奏,點(diǎn)擊后加入對應(yīng)class名字