Howard Bash
asked on
Handling empty sub-menus with CSS
I had this question after viewing The Menu is good, but needs a couple of Tweaks.
The DIV structure is generated via reading a JSON file and programmatically building the DIVs with whatever nesting the JSON file specifies. On occasion, the JSON file can only have a top level link and the sub menu is empty. The generated structure works but displays an empty node.
Is there any way to hide empty sub-menus?
I will attach a picture demonstrating the issue and the section of the DIV structure that produces it.
Here is the associated html fragment which produces it
The DIV structure is generated via reading a JSON file and programmatically building the DIVs with whatever nesting the JSON file specifies. On occasion, the JSON file can only have a top level link and the sub menu is empty. The generated structure works but displays an empty node.
Is there any way to hide empty sub-menus?
I will attach a picture demonstrating the issue and the section of the DIV structure that produces it.
Here is the associated html fragment which produces it
<div class="item">
<a href="http://www.w3schools.com/js/default.asp">99-JavaScript Tutorial</a>
<div class="sub-menu">
<div class="col_1 sub-menu-item">
</div><!-- Close Col Div -->
</div>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER