Currently, I am utilizing the Backstretch jQuery plugin and aiming to darken the background while scrolling down.
This is my progress so far: Setting the body background color to dark Adjusting the opacity of the background image to 0.4 when scrolling down 800px
The remaining task is to slow down the fade effect. At the moment, it transitions rapidly from opacity 1 to 0.4.
Below is my code:
$(window).scroll(function() {
if ($(window).scrollTop() > 800) {
$('.backstretch').css("opacity", 0.4).fadeIn("slow");
}
else{
$('.backstretch').css("opacity", 1).fadeIn("slow");
}
});
I would greatly appreciate any assistance in achieving a slower fade-in effect.