Title: Multi-level drop-down context menu
Tags: javascript;jquery;contextmenu;infinite;multi-level
Question: I am making a context(right click) menu plugin for jQuery, and it works fine for the first level. But I need it to have infinite levels. I already have the recursion down, but I think it's a problem with the showing/hiding. This is my code, so far: http://jsfiddle.net/H7GqA/4/ (Sorry for the messy code, plugin's for myself). The second-level item never appears, and I'm not sure what i'm doing wrong.
Thanks in advance - Tanner.

Here is the accepted answer: You have display:none on the .submenu elements and you do nothing to show them.
If you want them to be always on add the following rule
#ContextMenu .submenu {
display:block;
if you want to do it on hover of their parent do
for modern browsers
#ContextMenu .item:hover &gt; .submenu {
display:block;
I see the you have this code
cm.find(".item:has(.submenu)").hover(function(){
//$(this).find("ul").css('display', 'block');
//alert('blabla_1');
$(this).css('background-color', 'red');
});
the should work (if you uncomment the first line) and move that code in the doMain function. Because where you currently have it the #ContextMenu element does not exist yet.. so the binding does not happen..
Comment for this answer: Thanks! Still have to work out some positioning, but it shows the submenu on hover!


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2011:00:05/04/11', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<javascript><jquery><contextmenu><infinite><multi-level>', 'Title': 'Multi-level drop-down context menu', 'ViewCount': 1827, 'id': 5884332, 'user_AboutMe': '<p>A normal person, living my own life.</p>\n', 'user_AccountId': 206755.0, 'user_DisplayName': 'Tanner Ottinger', 'user_Reputation': 2890.0, 'user_Views': 205.0, 'user_id': 456237.0}}