I have an application that displays a menu if we right click on the central div (#body), in this div there are files represented in a list <li>
, each <li>
has as id #fichero
. My problem is that sometimes there are no files and if I click the menu is displayed (since I right click on #cuerpo
).
This I have programmed it like this:
$("#cuerpo").bind("contextmenu", function(e){
...despliego menu...
});
Easy solution? change #body by #file, but it does not work for me.
Does anyone give me the solution? What am I doing wrong?
Thanks