I’m writing this without testing, because lazy.
it should work, probably xD
$(function(){
var images = $(‘.yourClass’)
scrolledDistance = $(document).scrollTop()
windowHeight = $(window).height()
inView = scrolldDistance + windowHeight
$(images).each(function(){
var position = $(‘this’).position()
topOffset = position.top
if (inView <= topOffset ){
$(this).css({‘opacity’:’0′})
}
})
$(window).scroll(function () {
//update scrolled distance
scrolledDistance = $(document).scrollTop()
$(images).each(function(){
var position = $(‘this’).position()
topOffset = position.top
if (inView <= topOffset ){
$(this).animate({‘opacity’:’0′},500)
}
})
})
})