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