title: jquery width get 0
body: <p>jquery function width() always return 0. Here is my layout</p>
  
  <pre><code>&lt;div class="entity" id="id-@user.id"&gt;
     &lt;div class="inactive"&gt;
        &lt;div class="touch-header"&gt;                                               
           &lt;div&gt;
              &lt;small&gt;@user.name&lt;br&gt;@user.surname&lt;/small&gt;
           &lt;/div&gt;
  
           &lt;div role="button" data-toggle="modal" id="home_office_id-@user.id" class="home_office_log pull-right" style="margin-top: -2.2%;text-align:center; margin-right: 2px;opacity: 0.8;width: 50px; height: 50px;position: absolute; margin-left: 4.9%;z-index: 1;"&gt;
             ...
           &lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Then I have javascript code where I want to move content of tags &lt; small> &lt; /small> via animate method to the mid of div class="entity"</p>
  
  <pre><code>var lab = $('div.entity#id-' + userId).children().
          children().children().children('small');                         
  lab.css('position', 'relative').animate({
      left: $('.entity#id-'+userId).width() - lab.width() / 2 - 15
  }, 500);
  </code></pre>
  
  <p>But functions width() in both case returns 0. What can I do?</p>