Reputation: 179
how can I code the js file to directly put the navbar on the second div? Here is the codepen, it works but on the first load the navbar is sticked on the top of the site; I don't want it.
$(document).ready(function() {
$(window).scroll(function() {
if($(window).scrollTop() >= $('#main').outerHeight())
$('.navbar').removeClass('fixed');
else
$('.navbar').addClass('fixed');
});
});
Upvotes: 0
Views: 41