Menu icon Foundation

Coder

My Posts

  • 3
    Replies
  • Dropdown menu - close on click

    By Mitja P.

    dropdownautoclose

    Hi, I do not know what I missing, but is there no way to create a button with dropdown which closes automatically when you click an item in the menu? I know I can manually attach an event and programatically close it. But shouldn't that be built into the... (continued)

    Last Reply by Mitja P. about 3 years ago



My Comments

Mitja P. commented on Mitja P.'s post about 3 years

I have now checked with the latest version. Still no solution. What I want is a dropdown BUTTON. Example:
 
<a class="dropdown" data-toggle="X">Dropdown button <i class="fa fa-angle-down"> </i></a>
<ul id="X" class="dropdown-pane menu vertical" data-dropdown data-auto-focus="false" data-close-on-click="true">        <li><a>Item 1</a></li>        <li><a>Item 2</a></li></ul>
I want the dropdown to close automatically when I click on Item 1, without me doing it manually like this:
var t = $(event.target);t.closest('.dropdown-pane').foundation('close');
Does foundation support this? Am I using wrong classes. This used to be possible with version 5, but see no way with version 6.
 
Thank you!

Mitja P. commented on Mitja P.'s post about 3 years

This was with version 6.2.1.

Posts Followed

No Content

Following

    No Content

Followers

My Posts

My Comments

You commented on Mitja P.'s post about 3 years

I have now checked with the latest version. Still no solution. What I want is a dropdown BUTTON. Example:
 
<a class="dropdown" data-toggle="X">Dropdown button <i class="fa fa-angle-down"> </i></a>
<ul id="X" class="dropdown-pane menu vertical" data-dropdown data-auto-focus="false" data-close-on-click="true">        <li><a>Item 1</a></li>        <li><a>Item 2</a></li></ul>
I want the dropdown to close automatically when I click on Item 1, without me doing it manually like this:
var t = $(event.target);t.closest('.dropdown-pane').foundation('close');
Does foundation support this? Am I using wrong classes. This used to be possible with version 5, but see no way with version 6.
 
Thank you!

You commented on Mitja P.'s post about 3 years

This was with version 6.2.1.

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content