ContextMenu setup : Popup Context Menu « Dojo toolkit « JavaScript DHTML






ContextMenu setup

 

<html>
  <head>
    <link rel="StyleSheet" type="text/css" href="js/dojo/dijit/themes/tundra/tundra.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojo.parser");
      dojo.require("dijit.Menu");
    </script>
  </head>
  <body class="tundra">
        Right click to see the context menu.
        <div dojoType="dijit.Menu" contextMenuForWindow="true"
          style="display:none;">
          <span dojoType="dijit.MenuItem"
            onClick="alert('Item 1')">Item 1</span>
          <span dojoType="dijit.MenuSeparator"></span>
          <span dojoType="dijit.MenuItem"
            onClick="alert('Item 2')">Item 2</span>
        </div>
  </body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Right click in here to get the contextual menu