鼠标弹起时防止默认
preventDefault on mouse up
此代码无效。如何防止结构中出现上下文菜单?
canvas.on('mouse:up', function(options) {
if(options.target){
switch(options.e.button){
case 0:
// left click
break;
case 2:
// right click
options.e.preventDefault();
break;
}
}
});
您可以添加:
$('canvas').contextmenu( function() {
return false;
});
canvas.on('mouse:up'
之外...
此代码无效。如何防止结构中出现上下文菜单?
canvas.on('mouse:up', function(options) {
if(options.target){
switch(options.e.button){
case 0:
// left click
break;
case 2:
// right click
options.e.preventDefault();
break;
}
}
});
您可以添加:
$('canvas').contextmenu( function() {
return false;
});
canvas.on('mouse:up'
之外...