1$(window).on("scroll", function(){
2 if($(window).scrollTop() + $(window).height() - 100 >= $(".target").offset().top){
3 alert("On viewport");
4 }
5})
1body{
2 padding-top: 150vh;
3}
4
5.target{
6 background: red;
7 width: 100%;
8 height: 50px;
9 margin-bottom: 500px;
10}
1<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
2<div class="target">
3</div>