Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:33:27+00:00 2026-06-09T17:33:27+00:00

I use the jQuery contextMenu from Rodney Rehm in an SVG graphic. It works

  • 0

I use the jQuery contextMenu from Rodney Rehm in an SVG graphic. It works fine for basic usage.

But I need to get the ID (or any other property) of the SVG-Element which triggered the context menu to use it in the context menu’s item list to get dynamic item names.

I work with the Simple Context Menu demo and now want to replace these static menu items with dynamic ones depending on the ID of the SVG element which was clicked on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:33:29+00:00Added an answer on June 9, 2026 at 5:33 pm

    This may help you: http://medialize.github.com/jQuery-contextMenu/demo/dynamic-create.html
    Here’s some sample code:

    $(function(){
        $.contextMenu({
            selector: 'my-selector-here', 
            build: function($trigger, e) {
                // this callback is executed every time the menu is to be shown
                // its results are destroyed every time the menu is hidden
                // e is the original contextmenu event, containing e.pageX and e.pageY (amongst other data)
                // $trigger is the element that was rightclicked on - get its id here
                var id = $trigger.getTheIDSomehow()
                // build the menu items
                if (id == 1) {
                  menuItems = {...}
                else if (id == 2)
                  menuItems = {...}
                return {
                    callback: function(key, options) {
                        // this is called when one of the contextmenu options is clicked
                    },
                    items: menuItems
                };
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use jQuery form plugin(jquery.form.js) in my project. It works fine in Chrome/FF, but
I use jQuery to get values of presaved elements from some websites, using paths
I use JQuery Datepicker and cannot get data from it. In .html: <p>Date: <input
I use jQuery.load to load a localhost URL (eg: localhost/wp/contact) which it works fine,
We use jQuery modal dialog box to get confirmation from users before they delete
I use jquery picnet table filter - http://www.picnet.com.au/picnet-table-filter.html I need to display count of
I use jQuery to do AJAX calls. But specialchars like ÆØÅ (danish letter) comes
I use jquery autocomplete in my application but I am not satisfied on how
I use jQuery UI Sliders to provide a answer scale for users... (Rate from
I use jquery fancybox 1.3.4 as pop form. but I found fancybox can't bind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.