himynameis
himynameis

Reputation: 259

Display Accordion on CLick

enter image description here

When I click on the 3 line icon I currently just have a simple link back to the homepage of the website. I want to be able to click on it for it then to display a drop down menu so that I can choose a range of different page links for the site. This is to work on Mobile.

<div class="icon">
    <ul><a href="home.html"></ul>
    <img src="img/icons/menu-media.png"/></a>
</div>

So At the moment the icon links you to a page and nothing else but I am looking for a drop down menu. I have not used bootstrap, just html, css and basic jQuery.

Upvotes: 0

Views: 61

Answers (1)

Joga Luce
Joga Luce

Reputation: 39

One method:

  • First you need to add the collection of links for the different pages, probably in a NAV > UL.
  • Style it to be hidden.
  • Add a css class that makes the NAV visible when applied to it.
  • Put a javascript callback on the hamburger button (three lines) which toggles (adds/removes) the class to the NAV.

Upvotes: 1

Related Questions