Foundation 6 topbar animation with motion-ui

Using Foundation 6, I try to get a responsive topbar that involves an animation on toggle (small screens).

I have this:

<div class="top-bar">
        <div class="top-bar-title">
               <strong>MyTitle</strong>
            <span data-responsive-toggle="responsive-menu" data-hide-for="medium" class="responsive-menu">
                <span class="menu-icon" data-toggle></span>
            </span>
        </div>
        <div id="responsive-menu" data-toggler data-animate="hinge-in-from-top spin-out"> <!-- no matter the type of animation is -->
            <div class="top-bar-right">
                <ul class="dropdown menu" data-dropdown-menu>
                    <li>
                        <a href="#">1</a>
                    </li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                </ul>
            </div>
        </div>
    </div>

But even after importing motion-ui library, no transition happens.
Just a rough display:none to display:block of the menu and vice-versa.

It works when I replace data-responsive-toggle by data-toggle but I would lose responsiveness.

Is it a bug regarding Foundation 6?

Answers:

Answer

I had the same problem. Solved it by adding both data-toggle and data-responsive-toggle to the first div:

<div class="top-bar" data-toggle="navmenu" data-responsive-toggle="navmenu" data-hide-for="medium">
  <button class="menu-icon" type="button" ></button>
  <div class="title-bar-title">Menu</div>
</div>
<nav class="top-bar" id="navmenu" data-toggler data-animate="fade-in fade-out">
  <div class="top-bar-left">
    <ul class="menu">
      <li>Left Item 1</li>
      <li>Left Item 2</li>
    </ul>
  </div>
  <div class="top-bar-right">
    <ul class="menu">
      <li>Right Item 1</li>
      <li>Right Item 2</li>
    </ul>
  </div>
</nav> 

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.