Tutorial Detect First Visible Element of Certain Class
Adds a class of "first" to the first element that has a class of "activity" that is visible in the browser window. $(win...
https://iskablogs.blogspot.com/2014/03/tutorial-detect-first-visible-element.html
Adds a class of "first" to the first element that has a class of "activity" that is visible in the browser window.
$(window).scroll(function(){
var scrollTop = $(window).scrollTop();
var windowHeight = $(window).height();
var first = false;
$(".activity").each( function() {
var offset = $(this).offset();
if (scrollTop <= offset.top && ($(this).height() + offset.top) < (scrollTop
$(window).scroll(function(){
var scrollTop = $(window).scrollTop();
var windowHeight = $(window).height();
var first = false;
$(".activity").each( function() {
var offset = $(this).offset();
if (scrollTop <= offset.top && ($(this).height() + offset.top) < (scrollTop