<div class="slider">
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
</div>
$('.slide.current p').on('viewport', function(event) {
$(this).addClass('in-viewport');
});
function inWindow(s){
var scrollTop = $(window).scrollTop();
var windowHeight = $(window).height();
var currentEls = $(s);
var result = [];
currentEls.each(function(){
var el = $(this);
var offset = el.offset();
if(scrollTop <= offset.top && (el.height() + offset.top) < (scrollTop + windowHeight) && (el.is(":visible")))
result.push(this);
});
return $(result);
}
inWindow( $('.block') )