Each time an <i>
tag inside a <li>
is clicked, it toggles the display of the following <ul>
. To ensure that only one <ul>
is expanded at a time, clicking on another <i>
will collapse the previously expanded <ul>
.
For a demonstration, check out my sample code
<ul class="nav-main">
<li> <a href="/en/courses">Courses</a><i class="expand closed"></i>
<ul class="drop">
<li><a href="#">Campuses</a>
</li>
<li><a href="#">Online Learning</a>
</li>
<li><a href="#">Start dates and schedules</a>
</li>
<li><a href="#">Learning and Support</a>
</li>
</ul>
</li>
<li> <a href="#">Outcomes</a><i class="expand closed"></i>
<ul class="drop">
<li><a href="#">Career Starter Program</a>
</li>
<li><a href="#">Progress to a degree</a>
</li>
<li><a href="#">Career Pathways</a>
</li>
</ul>
</li>
</ul>