$(window).scroll(function(){
$('.reveal').each(function(){
if( 0 > ($(this).offset().top-$(window).height()/2)) {
$(this).addClass('toTop');
}else{
$(this).removeClass('toTop');
}
});
$('.reveal-left').each(function(){
if( 0 > ($(this).offset().top-$(window).height()/2)) {
$(this).addClass('toRight');
}else{
$(this).removeClass('toRight');
}
});
$('.reveal-right').each(function(){
if( 0 > ($(this).offset().top-$(window).height()/2)) {
$(this).addClass('toLeft');
}else{
$(this).removeClass('toLeft');
}
});
$('.reveal-top').each(function(){
if( 0 > ($(this).offset().top-$(window).height()/2)) {
$(this).addClass('toBottom');
}else{
$(this).removeClass('toBottom');
}
});
});