Jquery calculate position of div after animation
<p>Hey i have a div moving via a jquery animation and i am trying to calculate that divs position. The position is calculated on click but then the position before the animation is calculated and not after the animation.</p>

<p>Sooo basically how would i go about having the animation happen and then have the position calculated and make the appropriate buttons hidden?</p>

<p>Here is a example of what i have thus far. It is practically there except for the var galleryItemLeft being calculated before the animation completes. <a href="http://www.ehbeat.com/test/" rel="nofollow">http://www.ehbeat.com/test/</a></p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function(){

//Check width of Gallery div
var galleryWidth = $("#Gallery").innerWidth();

//Check width of GalleryItem
var galleryItemWidth = $(".GalleryItem").innerWidth();

    $('.MoveRight').hide();

    $(".MoveRight").click(function(){
  $(".GalleryItem").animate({"left": "+=100px"}, "slow");
  $(".GalleryItem2").animate({"left": "+=140px"}, "slow");
});

$(".MoveLeft").click(function(){
  $(".GalleryItem").animate({"left": "-=100px"}, "slow");
  $(".GalleryItem2").animate({"left": "-=140px"}, "slow");
});

$(".Controls").live("click", function() {
    position = $(".GalleryItem").position();
    galleryItemLeft = position.left;

    if(galleryItemLeft &gt;= "0") { 
        $('.MoveRight').hide();}
    else{
        $('.MoveRight').show();
    }

    if(galleryItemLeft &lt;= galleryWidth - galleryItemWidth) {
        $('.MoveLeft').hide();}
        else{
        $('.MoveLeft').show();
    }
});

});
&lt;/script&gt;
</code></pre>
