jQuery: get div-width after document is ready and rendered
<p>I'm trying to get the width of a div container to set another css attribute in another div  to the width of the first one, which I know after the page was fully loaded and rendered.</p>

<p>I have this code:</p>

<pre><code>$().ready(function() {
    doLayout();
}
function doLayout() {
    var $width = $("#sidebar").attr("width");
    $("#content").css("left", width);
}
</code></pre>

<p>The problem is, the ready is called before the page is rendered and thus width attribute is not set (or "undefined"). How can I determine the current width?</p>

<p><strong>EDIT:</strong>
After suggested changes I have this <a href="http://jsfiddle.net/jMgfT/5/" rel="nofollow">fiddle</a> but the code there is working, but in my real application it's not. So the problem is somewhere else, I guess :(</p>
