I am trying to make a div fade out when scrolled up. If you look at envato.com when you scroll down the about info fades in and then fades out when you scroll back up. Right now I am using the js below to make the fade in effect, but I'm not sure how to make the div fade out.
$(function() {
$(window).scroll( function(){
$('.fadeInBlock').each( function(i){
var bottom_of_object = $(this).position().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
/* Adjust the "200" to either have a delay or that the content starts fading a bit before you reach it */
bottom_of_window = bottom_of_window + 350;
if ( bottom_of_window > bottom_of_object ) {
$(this).animate({'opacity':'1'},500);
}
});
});
});