$('.product').css({'opacity': '0'})
$(window).scroll(function() {
var pos = $(window).scrollTop();
var prod = $('.product');
var prodPos = prod.position().top;
var windoww = $(window).height();
if (pos > prodPos - (windoww - 100)) {
prod.animate(({'opacity': '1'}))
}
});
var product = $('.product').css({'opacity': '0'});
product.each(function(){
var prod = $(this);
var prodPos = prod.position().top;
$(window).scroll(function() {
var pos = $(window).scrollTop();
var windoww = $(window).height();
if (pos > prodPos - (windoww - 100)) {
prod.animate(({'opacity': '1'}))
}
})
});