Hi guys, I have a bad time trying to resolve the conflict between the two onclick events. My project has an area with canvas and properties.
I can add elements (button click) to the canvas by adding them to It (These elements have a class of ".element" and they are div, and the canvas is also a div element).
So, as soon as I have an element on the canvas, I can see its properties (in the properties window) by clicking on it. To handle this click event, I executed the following function:
var canvas = $('#canvas');
$(function(){
canvas.delegate('.element','click', function(){
});
});
Now I want to implement a function that, when I click elsewhere on the canvas, clears the properties field (if the item is not selected). I tried to do this:
$(function(){
canvas.on('click',function(){
});
});
But now it cancels the first function (it is similar only to the second). Do you guys know how I can make a difference?