【发布时间】:2016-06-28 02:58:37
【问题描述】:
我的网络技术知识主要是 HTML 和 CSS。 我使用 bootstrap 和 jQuery 让导航卡在滚动上,它做了一段时间,然后在我开始添加新页面后停止。这是我的 JavaScript:
$('.carousel').carousel({
interval: 5000 //changes the speed
})
$(document).ready(function() {
$(window).scroll(function () {
//if you hard code, then use console
//.log to determine when you want the
//nav bar to stick.
console.log($(window).scrollTop())
if ($(window).scrollTop() > 280) {
$('#nav_bar').addClass('navbar-fixed');
}
if ($(window).scrollTop() < 281) {
$('#nav_bar').removeClass('navbar-fixed');
}
});
});
这里是my web page,您可以在其中看到问题。我该怎么办?
提前致谢
【问题讨论】:
标签: html css scroll navigation carousel