使用Bootstrap.js修复的导航栏 [英] navbar fixed using Bootstrap.js

查看:87
本文介绍了使用Bootstrap.js修复的导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Backbone + Bootstrap作为CSS框架的Webapp。

I am working on a webapp which uses Backbone + Bootstrap as the css framework.

我无法在移动浏览器中使用Bootstrap将导航栏固定在顶部。
根据引导程序,我们需要做的就是在导航栏中添加 navbar-fixed-top类...但不幸的是,它不适用于移动浏览器,但适用于桌面浏览器。

I am not able to set the navbar fixed to the top using Bootstrap in mobile browsers. As per Bootstrap all we need to do is add 'navbar-fixed-top' class in the navbar...but unfortunately its not working for me in mobile browsers but working in desktop browsers.

HTML

<div class="navbar navbar-fixed-top">
  <div class="navbar-inner" style="text-align:center">
    <div class="colL pull-left">
        <a href="/#back" id="back-btn" class="btns angular_btn pull-left" style="display:none"><span>Back</span></a>
        <a href="/#control_back" id="control-back-btn" class="btns angular_btn pull-left" style="display:none"><span>Back</span></a>
    </div>
    <div class="colR pull-right">
        <a class="btns pull-right" id="home" style="display: none" href="/#home" data-toggle="tab">Home</a>
        <a href="/#controls" id="controls" class="btns pull-right" data-toggle="tab">Now Playing</a>
    </div>
    <div class="colC">
        <div id="show_name"></div>
    </div>
  </div>
</div>


推荐答案

自2012年12月推出的Bootstrap v2.2.2开始导航栏确实可以在移动设备上使用位置:绝对来工作。

As of Bootstrap's v2.2.2 pushed in December 2012 fixed navbars do work on mobile using 'position: absolute'.

这篇关于使用Bootstrap.js修复的导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆