on order to save resource on the server I made the image view the same on all posts, and I want to change that image when the div appear to the user while scrolling the page down to save bandwidth. code:
<div class="image_showen" s="">
  <a href="{link}" target="">
    <img src="images/defaultimage.jpg" alt="{thread_title}" />
  </a>
</div>
my question is how to detect that the div is on view port and passing it to the function which is send request to the server to get that image back .
 
     
    