title: Bootstrap: "Cannot read property 'offsetWidth' of undefined" error with carousel
body: <p>I'm using multiple in carousels Bootstrap:</p>
  
  <pre><code>&lt;div id="carousel-586" class="carousel slide carousel-block" data-ride="carousel"&gt;
      &lt;ol class="carousel-indicators"&gt;
          &lt;li data-target="#carousel-586" data-slide-to="0" class="active"&gt;&lt;/li&gt;
          &lt;li data-target="#carousel-586" data-slide-to="1"&gt;&lt;/li&gt;
          &lt;li data-target="#carousel-586" data-slide-to="2"&gt;&lt;/li&gt;
      &lt;/ol&gt;
      &lt;div class="carousel-inner" role="listbox"&gt;
          &lt;div class="item active"&gt;
              &lt;img src="..." alt="..."&gt;
          &lt;/div&gt;
          &lt;div class="item"&gt;
              &lt;img src="..." alt="..."&gt;
          &lt;/div&gt;
          &lt;div class="item"&gt;
              &lt;img src="..." alt="..."&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- Controls --&gt;
      &lt;a class="left carousel-control" href="#carousel-586" role="button" data-slide="prev"&gt;
          &lt;span class="glyphicon glyphicon-chevron-left"&gt;&lt;/span&gt;
          &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="right carousel-control" href="#carousel-586" role="button" data-slide="next"&gt;
          &lt;span class="glyphicon glyphicon-chevron-right"&gt;&lt;/span&gt;
          &lt;span class="sr-only"&gt;Next&lt;/span&gt;
      &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>However, I'm receiving an error in JavaScript:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'offsetWidth' of undefined</p>
  </blockquote>
  
  <p>I've found a few similar problems (<a href="https://stackoverflow.com/questions/8615840/jquery-carousel-error">1</a>, <a href="https://stackoverflow.com/questions/29027830/getting-cannot-read-property-offsetwidth-of-undefined-with-bootstrap-carousel">2</a>), but they don't appear applicable to me.</p>
  
  <p>Despite the errors the carousel functions without problems, but I'd prefer to know what's causing the errors and fix them.</p>
  
  <p>Any suggestions would be great.</p>