Answer the question
In order to leave comments, you need to log in
Fabric.js How to handle a click on an object?
I read the article https://habrahabr.ru/post/162367/ several times.
I'm trying to figure out how to make a click on an object.
The example has a structure:
canvas.on('mouse:down', function(options) {
if (options.target) {
console.log('an object was clicked! ', options.target.type);
}
});
var x ;
canvas.on('mouse:down', function(options) {
if (options.target) {
x = options.target.type;
if (x == 'path') {
console.log( x + ' is here');
}
}
});
path.on('mouse:down', function() {
console.log('click in path');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question