代码如下:
$(document).ready(function() {
$(window).scroll(function() {
var windowpos = $(window).scrollTop();
var navbar = $('#navbar');
// if win >= navbar and not already a sticky
if (windowpos >= navbar.position().top && !navbar.hasClass("
我试过使用填充、文本对齐中心、浮动和边距,但是似乎没有什么工作,列表项目都是固定的。它与引导程序的CSS或JS冲突吗?我对引导非常陌生,对CSS和HTML相对较新,所以我可能遗漏了一些东西,但是我似乎找不到任何关于这个问题的东西。
这是我的代码(很抱歉我的评论太乱了):
/*controls the style of the entire navbar, including border and background clr*/
.navbar.navbar-default {
background-color: #D9D9D9;
border-color: #143DAF;