JSFiddle - React, Tailwind, and code Playground
HTML
<div id="jiff">
</div>
<video id="test">
</video>
CSS
#jiff {
width: 100%;
height: 2000px;
background: red;
}
#test {
width: 100%;
height: 1000px;
background: blue;
}
JavaScript
$(window).scroll(function () {
var scrollTop = $(window).scrollTop();
var scrollToVid = $('#test').offset().top
console.log(scrollTop);
console.log(scrollToVid);
if ($(window).scrollTop() >= 2008) {
alert('You reached to the video!');
}
});