Trigger Event On Reveal of Element
$(document).one('someTrigger', function(){
console.log('Do something');
});
$(window).on('scroll', function(){
var distanceUntilVisible = $('.some-element').position().top - (window.scrollY + window.innerHeight);
console.log(distanceUntilVisible);
if( distanceUntilVisible <= 400 ){
$(document).trigger('someTrigger');
}
});