FadeIn as the browser descends

1

I have a problem, I think it's more logical. It's the following I'm trying to make that effect from when I'm rolling the site down the content will popping up.

$(function(){
    $(window).scroll(function () {
      if ($(window).scrollTop() >= $(".j_show").offset().top) {
        $(".j_show").each(function () {
        $(this).delay("1000").fadeIn("2000");
      });
    }
});
});

The .j_show class is that of content, and various content with that class. The problem is that when ($(window).scrollTop() >= $(".j_show").offset().top) arrives at the time it is to give fadeIn , it gives, more appears are all that are with the class, and not what I want, I want fadeIn to execute content by contents depending on the height.

ps: I already tried it without the function each , more logically than the same.

# help

    
asked by anonymous 13.08.2015 / 21:32

1 answer

0

Try this logic.

   $('.j_show').each(function(){
        var fade = $(this).offset().top;

        var topOfWindow = $(window).scrollTop();
        if (fade < topOfWindow + 650) {
            $(this).delay(1000).fadeIn(2000);
        }
    });
    
13.08.2015 / 21:40