I am very new to javascript and only need to use one simple bit of code but can't seem to find anything on google.

I need an image to disappear when the webpage is scrolled all the way to the right. So when the page can't scroll anymore the image disappears.

The only thing I could find was this:
<script type="text/javascript">window.setTimeout("document.getElementById('scrollingPic').style.display='none';", 2000); </script>

However this just makes the image disappear after 2 seconds.

Any help would be appreciated!