I saw several websites with this effect, however, it seems that he lost the frame rate in my attempt. I basically want to change the opacity of the element, the more the user scrolls.
$(window).scroll(function(event){
$("#responsive-slider-with-blocks-1").css("opacity", 1 - $(window).scrollTop() / 1500);
}
Is there a better way to do this? (Ace would be just CSS, but not possible).
I'm really not a fan of scroll event bindings.
Edit:
Due to a change in the opacity of an element that spans the entire viewport, there may be a reason why the frame rate drops. Could fading into the black div covering an element not reduce the frame rate so much?
source
share