I have two bits of code that I want to merge, but not sure on the actual correct markup and how to write it correctly.
function EasyPeasyParallax() {
scrollPos = $(document).scrollTop();
$('#header_nav').css({
'background-color': 'rgba(0, 0, 0, 0.8)'
//'opacity': 0.5+(Math.min(scrollPos/100,1))
});
};
$(function(){
$('body').bind('mousewheel',EasyPeasyParallax);
});
The opacity selector works when I scroll down the page. However, I want to only target the background color of the div. How can I combine the 'background-color' selector with the scrollPos/100 code?