title: Bootstrap Carousel same image size (Exception offset)
body: <p>I am getting an exception in javascript, and I know this is because of image size..</p>
  
  <p>I want my carousel to have a fixed size for the images, and to auto adjust/resize the image (if it gets distorted or pixelized its not a problem, I just want the full image occupying the size of the carousel.</p>
  
  <p>I have been playing with max-width and width and couldn't get it work.
  I want this to be responsive also.</p>
  
  <p><strong>Here is my html code:</strong></p>
  
  <pre><code>&lt;div id="myCarousel" style="display: block;" class="carousel slide" data-ride="carousel"&gt;
      &lt;ol class="carousel-indicators" id="carouselIndicators"&gt;
          &lt;li data-target="#myCarousel" data-slide-to="0" class="active"&gt;&lt;/li&gt;
          &lt;li data-target="#myCarousel" data-slide-to="1" class=""&gt;&lt;/li&gt;
      &lt;/ol&gt;
  
      &lt;div class="carousel-inner" id="carouselData" role="listbox"&gt;
        &lt;div class="item active"&gt;
            &lt;h3&gt;Random text 1&lt;/h3&gt;
            &lt;p&gt;Random text 2&lt;/p&gt;
            &lt;img src="imageurl.png" alt=""&gt;
         &lt;/div&gt;
          &lt;div class="item"&gt;
                &lt;h3&gt;Random text 3&lt;/h3&gt;
                &lt;p&gt;Random text 4&lt;/p&gt;
                &lt;img class="tales" src="imagelink.png" alt=""&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"&gt;
          &lt;span class="glyphicon glyphicon-chevron-left" aria-hidden="true"&gt;&lt;/span&gt;
          &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"&gt;
          &lt;span class="glyphicon glyphicon-chevron-right" aria-hidden="true"&gt;&lt;/span&gt;
          &lt;span class="sr-only"&gt;Next&lt;/span&gt;
      &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Here is javascript exception (The slider doesnt work):</strong></p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'offsetWidth' of undefined</p>
  </blockquote>