I am having trouble adjusting the opacity of an element as I scroll down a page. Despite my efforts, the background color of the element remains unchanged.
$(document).on('scroll', function (e) {
$('.navbar-default').css('background-color: rgba',"70","103","26",($(document).scrollTop() / 550));
});
This is my CSS code:
.navbar-default {
/* background-color: #1b1d2a; */
background-color: rgba(70,103,26,0.1);
border-color: #1b1d2a;
}
The issue seems to stem from my lack of understanding regarding how to manipulate the specific style
background-color: rgba(70,103,26,0.1);
using the jQuery .css() API documentation, even though I have seen similar methods work in other examples.