Responsive navbar collapsing animation with AngularStrap

余生颓废 提交于 2019-12-07 22:16:58

问题


I'm trying to recreate collapsible Bootstrap responsive navbar with AngularStrap.

Here is plunker:

<div class="navbar navbar-inverse">
  <div class="container" bs-collapse start-collapsed="true">
      <div class="navbar-header">
          <button class="navbar-toggle" type="button" bs-collapse-toggle>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
          </button>
      </div>
      <div bs-collapse-target>
          <ul class="nav navbar-nav">
              <li>
                  <a href="#">Link</a>
              </li>
              <li>
                  <a href="#">Link</a>
              </li>
          </ul>
      </div>
  </div>
</div>

bs-collapse directive fits Bootstrap navbar quite easily, but it doesn't support collapsing animation out of the box.

How it can be done?

Is there a way to do this following Bootstrap workflow and utilizing its .collapsing animation instead of re-inventing the wheel (but simple LESS/SASS mixin that makes use of it is also fine)?


回答1:


To get the animations working, you may need to include angular-motion AND the angular-motion.min.css file that's part of the angular-motion package. The reference to the CSS file isn't part of the main documentation. I'm pretty sure I found references to it here on StackOverflow when I had similar issues.



来源:https://stackoverflow.com/questions/30564475/responsive-navbar-collapsing-animation-with-angularstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!