Okay, so I\'ve been searching for a simple way to fade in a div when a user scrolls it into view, but I can\'t find a straight solution.
HTML>
Here is solution, is set on 300px
$(document).ready(function(){
var view = {};
var checkPosition = function(){
var elem = $('.fadethisdiv'), top = elem.offset().top;
if (top - view.limit < 300) {
elem.css('display','none');
}
};
$(window).bind('scroll', function() {
view.top = $(window).scrollTop();
view.limit = view.top + $(window).height();
checkPosition();
});
});
http://jsfiddle.net/kz2z5/4/
Enjoy! :)