0
我對網絡技術的瞭解主要是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你可以看到這個問題。我能做些什麼呢?
在此先感謝
謝謝SOOOO了,讓我抓狂這個! :) – Dee
@Dee沒問題。繼續並標記爲已接受,以便解決類似問題的其他人可以找到答案。 – EnigmaRM
我該怎麼做,我在這裏是新的,我環顧四周,但似乎無法看到任何說「答案接受」 – Dee