在画布中检测鼠标滚轮

时间:2010-11-25 19:33:10

标签: html canvas

如何在我尝试使用的画布中检测鼠标滚轮移动:

canvas.addEventListener( “滚轮”,startStroke,FALSE);

但它不起作用.. 我该怎么办.. 提前谢谢..

1 个答案:

答案 0 :(得分:2)

tabindex元素中添加canvas,这会使其收到事件:

 <canvas width="500" height="500" tabindex="2"></canvas>