Navbar Box Shadow on Scroll

Hi,

I would like to have my navbar add a box-shadow after scroll on the homepage. Is this possible? I found this code on codepin but the javascript is not working.

$(window).scroll(function() {
if ($(window).scrollTop() > 10) {
$(’#navBar’).addClass(‘floatingNav’);
} else {
$(’#navBar’).removeClass(‘floatingNav’);
}
});

Any idea how to make the javascript work with Pro theme?

Thanks!

Hello Philip,

Thanks for writing in!

The JS code will work if you have added a unique ID in the bar settings of your custom header.
Screen Shot 2021-03-04 at 10.34.41 AM

Please be advised that this is a customization that is beyond the scope of our support. You may need to contact a 3rd party developer for further assistance.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.