javascript - jQuery second contextMenu don't show properly -


i made example http://jsfiddle.net/german_martin/oprkvys1/ of problem.

i have big div (the blue one) contextmenu , inside div (green one) contextmenu. both contextmenu shows right click.

if make right clic in blue div contextmenu shows fine. when clic in green div still appears old contextmenu. if refresh page , clic in green div, shows correct contextmenu.

this html:

<div class="cuadrofondo">     <div class="singleitem">item 1</div>      <div class="singleitem">item 2</div>      <div class="singleitem">item 3</div>      </div> 

this js code:

//centralizacion del dialog modal en la pantalla $(document).ready(function () {      $.contextmenu({         selector: '.cuadrofondo',         events: {             //funcion para cambiarle el titulo la opcion seguridad en el menu flotante             show: function () {                 var id = $(this).attr('id');              },         },         callback: function (key, options) {               if (key == "expand") {                 alert("expand");             }              //se borra un desarrollador             if (key == "creargrupo") {                 alert("creargrupo");             }              //se edita la seguridad del globo             if (key == "seguridadgrupo") {                 alert("jejeje")             }          },         items: {             "expand": { name: "irak", icon: "add-expand" },             "sep1": "--main menu--",             "creargrupo": { name: "afganistan", icon: "crearnuevo" },           }     });       $.contextmenu({         selector: '.singleitem',         events: {             //funcion para cambiarle el titulo la opcion seguridad en el menu flotante             show: function () {                 var id = $(this).attr('id');              },         },         callback: function (key, options) {               if (key == "expand") {                 alert("expand");             }              //se borra un desarrollador             if (key == "creargrupo") {                 alert("creargrupo");             }              //se edita la seguridad del globo             if (key == "seguridadgrupo") {                 alert("jejeje")             }          },         items: {             "expand": { name: "miami", icon: "add-expand" },             "sep1": "--submenu--",             "seguridadgrupo": { name: "florida", icon: "seguridad" }          }     });   }) 


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -