In relation to my previous question , I am looking to create an effect where as the user scrolls down the page, the opacity of the subsequent divs will increase to cover the main video. A working example can be found here: https://jsfiddle.net/Leytgm3L/38/. The issue arises when the window size is reduced, preventing the section from fully covering the video beneath it unless the user continues scrolling. How can I ensure that the video is completely covered upon reaching it?
$("#black").css("opacity",$("body").scrollTop()/1000);
The problem may be with the value of $("body").scrollTop()
. How can this be rectified?