I recently made a tweak to this code that successfully moves the background in the opposite direction of the scroll. However, there is now an issue where it leaves a blank space at the top, even when the background is set to repeat. The change I made was simply removing the "-" minus sign from -(scrolled*0.15)+'px').
function parallax(){
var scrolled = $(window).scrollTop();
$('.background').css('top',(scrolled*0.15)+'px');
}
While the modified code functions as intended, the problem with the white gap at the top remains. Is there something crucial that I'm overlooking? Any insights would be greatly appreciated!