- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个标准的 Bootstrap 导航栏,滚动 50 像素后,jQuery 添加词缀,如下所示:
<script type="text/javascript">
$('#mainNav').affix({offset:{top:0}})
</script>
由于这会将导航栏从 position:relative
切换到 position:fixed
,因此当导航栏下方的内容跳到屏幕顶部以填充时会导致抖动空间。
我一直在尝试,但无法阻止这种跳跃的发生,或者至少无法使其顺利进行。我试图从一开始就固定导航栏,并为导航栏的高度添加 margin-top
,但不幸的是,这无法正常工作。
CSS
.navbar-default {
background:#fff!important;
border:0;
border-top:4px solid #01203F;
height:110px;
border-radius:0;
margin:0;
}
@media(min-width:768px) {
.navbar-default {
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
border-bottom: none;
z-index:10001!important
}
.navbar-default.affix {
width:100%;
background: #0E2A45!important;
border-bottom: none;
}
}
最佳答案
通过将导航栏放在包装器中解决了这个问题。
导航栏高度为 110px,因此添加:
<div class="nav-wrapper">
<div class="navbar affix">...</div>
</div>
CSS
.nav-wrapper {min-height:110px}
关于jquery - 切换到词缀时 Bootstrap 导航栏会抖动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44737602/
匈牙利语比英语要复杂一些。单词可以被非常奇怪地更改,这意味着如果我们想为用户提供良好的体验,我们需要微调搜索。 我已经做了很长时间的研究,并且遇到了一些可能的解决方案,但我不确定它们是否适合我们的需求
我已将词缀应用到我的导航栏容器。我在 xs 和 sm View 上得到了想要的结果,但对于更大的 View 我有一个小问题。附加菜单后,它会扭曲宽度并超出初始容器宽度。有人可以看看我哪里出错了吗?
我正在尝试使用 Twitter Bootstrap 的新词缀选项,但不太正确。 我在 http://jsfiddle.net/yPgUu/1/ 中整理了一个示例相关部分是 左侧导航从正确的位置开始。
我正在尝试 twitter-bootstrap 上的词缀功能,这个 js 方法做了什么,因为我看到它只是把选择的元素放在: 位置:固定; 或者我弄错了,它还控制元素 window offsets TO
Please see this fiddle.我有一个主要内容 div 和一个侧边栏,我想在用户滚动时将其附加到页面顶部。一切正常,除了在移动设备上查看时: 如果没有词缀,这些列的行为与 Bootst
这就是我的页面的结构。左栏 (col-lg-3)中心列 (col-lg-6)右栏(col-lg-3) 虽然我的主要内容会在中心栏中,但我希望我的左栏和右栏在某个滚动位置后固定(或粘性)。 我在互联网上
当我向下滚动时,我想隐藏大 Logo 并显示小 Logo 我不知道我的 CSS 在这里搞砸了什么: .big_logo { } .big_logo.
twitter bootstrap 文档站点,左侧导航固定在移动布局的顶部。例如:http://twitter.github.com/bootstrap/javascript.html 我想在不使用
我有一个小问题,我需要你的帮助来解决它。 我有一个带有 span12 和词缀的导航栏。滚动有效,但文本始终位于导航栏下方,当我单击某个元素时,我看不到我刚刚单击的标题,这就是我正在搜索的内容。 我实际
请查看以下链接: bootstrap nav example 我想在导航方面实现相同的结果。所以当我们开始浏览网页时,菜单在底部,向下滚动后它会回到顶部并停留在那里。我在 Bootstrap 的文档中
我正在使用最新版本的 Twitter Bootstrap 并尝试在我网站上的 div 上实现 Affix: Join Headline/h4> 但我收到了奇怪的行为: 在 Chrome
我正在尝试实现 Bootstrap 的附加导航栏,例如 this example. 这里是 a pen我所拥有的。似乎“词缀”类总是在导航栏元素上激活。也就是说,当我这样做的时候 .affix {
我正在尝试使用 Affix,但我遇到了一些问题:当我向下滚动时 - 我的词缀 div 在页脚下部分消失了,这里是 jsbin example和 code .我怎样才能避免这种情况? data-offs
我有一个 Bootstrap 词缀 div,用作从长列表中选择的项目的一种剪贴板。它以一种令人愉悦的方式在页面左侧上下 float ,但是当用户从列表底部选择足够的项目时,div 会在页脚下方增长。监
我正在迁移到 bootstrap 3.0.0,但左侧的附加菜单出现问题:一旦它被附加(滚动 10 像素后),它的宽度就会改变。在 this fiddle它变得更小,在我的真实网站中它变得更宽并扩展了实
如果查看此链接,您将看到向下滚动时,导航具有词缀和 scrollspy 功能(来自 bootstrap 3) http://codepen.io/datanity/pen/thnua 但是,如果您在顶
我正在尝试使用 Bootstrap 的 affix.js 设置一个简单的示例。 但是,问题是当我试图粘贴的元素从 affix-top 切换到附加。它永远不会从那里恢复。 我设置了一个小的 jsfidd
我有一个使用 Bootstrap 3.0.3 构建的遗留应用程序。在这种情况下,我们无法更新 Bootstrap。 也就是说,我正在尝试使用 3.0.3 来使用词缀功能。 我在 jsfiddle 上设
我正在尝试整合一些代码并最大程度地减少我们当前使用的自定义 javascript 和 jquery 插件的数量。 我们当前的页面有一个与此类似的网格: +--------------------+ |
我想做的是将速记符号与 ISO 前缀(1k = 1000、-1ki = -1024 等)相匹配。这个正则表达式很接近: ^([+-]?)(\d+)((?i)[KMGTPEZY]?(?i)i?$) 但它
我是一名优秀的程序员,十分优秀!