Note that there are some explanatory texts on larger screens.

plurals
  1. PORight Click Contextmenu incorrectly displaying after returning false on menu
    primarykey
    data
    text
    <p>first time poster but use this site for examples all the time. My small problem is this (and I've researched it, but can't find a solution to my problem)...</p> <p>I have a text list of 50+ names, and one item for each day, (so a matrix of 50+ x 7) where I want to be able to right click on daily text (a div per day), and display a menu relating specifically to that item per day. This would be no big deal, however, because I need to identify every item individually and use the DivID by JS to call another function, this becomes a big deal. I looked at other jquery menu options, but couldn't figure out how to dynamically retrieve the name correctly.</p> <p>The problem I have is not creating the menu and capturing the item ID, but it's stopping the ContextMenu from appearing after the right click has been made. </p> <p>I want the page to have the right click menu elsewhere, but not on these DIV elements, the just menu I'm creating.</p> <p>The following code has been simplified...</p> <p>This is the JS I'm using:</p> <pre><code>function go(e,idname) { var rightclick; e = e || window.event; if (e.which) rightclick = (e.which == 3); else if (e.button) rightclick = (e.button == 2); var a = idname.id; a = (a.substring(11)); ShowContent('ToggleValueFloat'); // Display the DIV $(document).ready(function() { $('#ToggleValueFloat').html('MY MENU TEXT' + &lt;a href="Javascript:ToggleDay(' + a + ');"&gt;EXAMPLE&lt;/a&gt;); return false; }); return false; } function ShowContent(d) { if(d.length &lt; 1) { return; } var dd = document.getElementById(d); AssignPosition(dd); dd.style.display = "block"; } </code></pre> <p>This is the PHP I'm using for the example:</p> <pre><code>echo '&lt;a id="togglePopup' . (int)$arrayEId[$allEntries] . '" onmousedown="go(event,this); return false;"&gt;example&lt;/a&gt;'; </code></pre> <p>This is the DIV I'm using to show.</p> <pre><code>&lt;div id="ToggleValueFloat" style="display:none; position:absolute; border-style: solid; background-color: white; padding: 5px;"&gt;&lt;/div&gt; </code></pre> <p>I'm trying to get it to return false every time so the Context menu won't display, but it doesn't work. I can disable right click altogether on the page, but this will prove more unproductive than ever.</p> <p>Any thoughts/help would be great! I'm open to options. Thanks, Steve</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload