I'm building my webapp and I dont like the way my navbar looks when collapses. I'd rather just have a different navbar for mobile users and basically any browser that falls below the width threshold.

我正在构建我的webapp,我不喜欢我的导航栏在崩溃时的样子。我宁愿为移动用户和基本上任何低于宽度阈值的浏览器设置不同的导航栏。

So rather than how bootstrap just turns your navbar into a list, I'd rather make it look nice with clickable icons.

因此,而不是引导程序如何将导航栏变为列表,我宁愿使用可点击的图标使其看起来很漂亮。

What's the best way of going about this? Here's my current navbar.

解决这个问题的最佳方法是什么?这是我当前的导航栏。

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">

      <div class="navbar-header">


          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <div {{action toggleProperty "showNotifications"}}  id="not-container-mobile" class="navbar-toggle" style="position:relative">
            <i
               class="icon-globe icon-large use-blue"></i>         

               {{#if showNotifications}}
               {{view App.NotificationView}}
               {{/if}}
          </div>
          <a class="navbar-brand " href="#"><img class="logo"
             src="/images/app_dark.png"></a>
      </div>




<div class="navbar-header navbar-right">
      <div class="navbar-collapse collapse" >

        <ul class="nav navbar-nav navbar-right">
      <li>
          <div {{action toggleProperty "showNotifications"}} id="not-container"  style="position:relative">
            <i
               class="icon-globe icon-large use-blue"></i>         

               {{#if showNotifications}}
               {{view App.NotificationView}}
               {{/if}}
          </div>
      </li>
        <li>{{view App.SearchView}}</li>

        <li>
        <div class="navbar-header navbar-right">
              <p class="navbar-text">
              {{#link-to "user" currentUser._id.$oid}}
              {{currentUser.name}}
              {{/link-to}}

              </p>
        </div>
        </li>
        <li>
        <div id="settings-cog" class="navbar-header navbar-right">
           <li  class="dropdown">
              <a class="dropdown-toggle" data-toggle="dropdown" href="#">          
                 <i class="icon-cogs icon-large use-blue"></i>
              </a>
              <ul class="dropdown-menu">
                <li><a data-toggle="modal" data-target="#changePassModal" href="#">Change Password</a></li>
                 <li><a {{action "toggleEditView" target="base"}} data-toggle="modal" data-target="#editModal" href="#" href="#">Edit Profile</a></li>
                 <li><a href="/#/logout">Logout</a></li>
              </ul>
           </li>
        </div>
        </li>

        </ul>

        </div>
        </div>



        </div>


</nav>

1 个解决方案

#1


26

Just create two navbars. On your full-sized navbar add the classes .hidden-sm and .hidden-xs. Then, on your mobile navbar add the classes .visible-xs and .visible-sm. That way, you only see the navbar for the sizes you've designated. For more options, see Responsive utilities.

只需创建两个导航栏。在您的全尺寸导航栏上添加类.hidden-sm和.hidden-xs。然后,在您的移动导航栏上添加类.visible-xs和.vi​​sible-sm。这样,您只能看到指定尺寸的导航栏。有关更多选项,请参阅响应实用程序。

更多相关文章

  1. 浏览器的地址栏尺寸是否会影响CSS媒体查询?
  2. 怎么动态设置html的canvas元素的尺寸?
  3. 获取机器人屏幕的尺寸
  4. 必须在调用加载前设置广告尺寸和广告单元ID

随机推荐

  1. golang判断map中key不存在的方法
  2. golang中“var”与“:=”的区别
  3. golang jwt前端怎么验证
  4. 关于golang中无法获取地址问题的解析
  5. golang判断js文件是否存在
  6. golang调用cmd命令时如何隐藏dos窗口
  7. golang中...是什么意思?
  8. docker为何选择golang开发?
  9. golang不规则json解析
  10. golang recover后怎么返回