Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript issue with sticky navigation Re: issue with sticky navigation

#137087
sameera
Member

i found a solution.. Thanks for trying to help :)

$(window).scroll(function() {
var navheight = $(‘window’).height();
if ($(window).scrollTop() >= navheight) {
$(‘.site-navigation’).addClass(‘fixed’);
}
if ($(window).scrollTop() < navheight) {
$(‘.site-navigation’).removeClass(‘fixed’);
}
});