Is there a way to make all the images within the <body></body> tag fade when scrolled down to?

I'm trying to implement it into my Tumblr blog, and although it would work for photo posts, I cannot achieve that same effect with text posts where I would have to go, one by one, adding the "<a class="img" rel="{image ulr}".... </a>" It just seems like a pain and I feel like there could be a different way to approach this.