问题
By default in mmenu, you have to click the arrow (to the right of the menu item) to show the submenu.
Is there a way to change it so that when you click anywhere on a menu item (doesn't have to be the arrow) it will expand as well?
My menu is roughly like this:
<ul>
<li><a href='Page1.aspx'>Item with no submenu</a></li>
<li><a>Click this to expand</a>
<ul>
<li><a href='sub1.aspx'>Submenu 1</a></li>
<li><a href='sub2.aspx'>Submenu 2</a></li>
</li>
</ul>
回答1:
It is possible to do this with using span tags (as seen here in the right menu on one of their demos). Give this a try:
<ul>
<li><a href='Page1.aspx'>Item with no submenu</a></li>
<li>
<span>Click this to expand</span>
<ul>
<li><a href='sub1.aspx'>Submenu 1</a></li>
<li><a href='sub2.aspx'>Submenu 2</a></li>
</ul>
</li>
</ul>
(You were also missing a closing on your nested unordered list.
回答2:
it won't work by adding span. You have to handle it via events
回答3:
Span does work but you have to use <span></span>
INSTEAD of <a href></a>
:
<li><span>About us</span>
<ul>
<li><a href="#about/history">History</a></li>
<li><a href="#about/address">Our address</a></li>
</ul>
</li>
来源:https://stackoverflow.com/questions/22703259/mmenu-click-a-menu-item-to-expand