JQuery make image invisible if outside div
<p>I'm trying to create a slider in JQuery. I have two images on top of eachother inside a div. When the right button is pressed I want to make the underlying image start left to it and slide it to the right on top of the other image. I use this code for that:</p>

<pre><code>var position = $("#IMAGE1").position();
var width = position.left-1050;
$("#IMAGE1").css('left', width);
$("#IMAGE1").animate({"left": "+=1050px"}, "slow");
</code></pre>

<p>Now I only want the part of the image visible that is INSIDE the div, not when its outside (it would look really sloppy because the div has a border). Question is, how?</p>
