callback on .width()?
<p>I'm setting a variable to the width of an image so that I can make a description div appear with the correct width. However, jQuery doesn't seem to have a callback function to suit my needs. What shall I do?</p>

<pre><code>$(document).ready(function () {
    // declare photo width variable
    var photo_width = 0;
    $('.chImg').click(function () {
        // get img src and chop it up       
        var srcv = $(this).attr('src');
        var sliced = srcv.slice(6);
        // return the base number of the image for correspdonding div
        // corresponding div is "d#"
        var divnum = sliced.substring(0, sliced.length - 4);
        // fade out active description div
        $(".activeDescript").each(function () {
            $(this).removeClass("activeDescript");
            $(this).fadeOut(110);
        });
        // change picture
        $("#chBox").fadeOut(110, function () {
            $("#chBox").html("&lt;center&gt;&lt;img src='" + sliced + "'/&gt;&lt;/center&gt;");
        });
        // vertical align
        $("#chBox").vAlign();
        $('#chBox').waitForImages(function () {
            // wait for images before grabbing img width
            $("#chBox img").each(function () {
                photo_width = $(this).width();
                $(".description").width(photo_width);
                $("#d" + divnum).fadeIn(300);
                // make this descript active
                $("#d" + divnum).addClass("activeDescript");
            });
            $("#chBox").fadeIn(200);
        });
    });
</code></pre>

<p>I'm mostly concerned with the code around photo_width = $(this).width(); as I want to ensure that the following code is executed AFTER that's happened.
Ideas?
I know that the description div is not being set properly because it takes 2 clicks to get it right! You can see the error at www.graysonearle.com/newtest and click on the first box "Frog Utopia" and click through a few thumbnails.</p>
