Loading ...
Sorry, an error occurred while loading the content.

assign contextmenu action

Expand Messages
  • xiaoshun_yu
    hi All, in my case I ve two files menu.svg and main.js in menu.svg I write Custom Menu
    Message 1 of 1 , Feb 1, 2007
    • 0 Attachment
      hi All,
      in my case I've two files menu.svg and main.js
      in menu.svg I write
      <svg>
      <defs>
      <menu id="Menu">
      <header>Custom Menu</header>
      <item id="link">link</item>
      <item id="delete">delete</item>
      </menu>
      </defs>
      </svg>

      and in main.js, I want to assign a function to the "link" item,
      but I find my way does not work. I tried like:
      this.main = function(){
      svgdoc.getElementById("link").setAttribute("onactivate",
      this.func);//not work
      //or
      svgdoc.getElementById("link").addEventListener("onactivate",
      this.func, false);//not work
      this.func = function(){
      alert("sdf");
      }
      }

      Thank you very much in advance
    Your message has been successfully submitted and would be delivered to recipients shortly.