bootstrap 4 navbar fixed positioning

Bootstrap 4 – changes fixed-top Navbar background color on scrolling

// navbar background color change on scroll $(window).scroll(function(){ var scroll = $(window).scrollTop(); if(scroll < 300){ $(‘.fixed-top’).css(‘background’, ‘transparent’); } else{ $(‘.fixed-top’).css(‘background’, ‘rgba(23, 162, 184, 0.9)’); } });