我已經修好了自己canvas
,可以在+ disable selection + detecting cross browser when the mouse is clicked上塗漆。使用jQuery在畫布上繪製時更改光標?
這就是:http://jsfiddle.net/EsYqm/52/
但我怎麼能更改光標(不要介意到),而我在按下鼠標左鍵(這意味着 - 而畫)
(即時通訊使用鉻27)
我已經修好了自己canvas
,可以在+ disable selection + detecting cross browser when the mouse is clicked上塗漆。使用jQuery在畫布上繪製時更改光標?
這就是:http://jsfiddle.net/EsYqm/52/
但我怎麼能更改光標(不要介意到),而我在按下鼠標左鍵(這意味着 - 而畫)
(即時通訊使用鉻27)
添加到您的CSS ...
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
canvas:active, canvas:focus {
cursor: crosshair;
}
添加
$('canvas').css('cursor', 'text');
後if (letsdraw === true)
所以您的病情會
if (letsdraw === true)
{
$('canvas').css('cursor', 'text');
ctx.lineTo(e.pageX - canvasOffset.left, e.pageY - canvasOffset.top);
ctx.stroke();
}
不工作........ –
我試着在jsfilldle。你可以嘗試一下 – Dolly