title: Twitter Bootstrap Carousel doesn't auto-start
body: <p>Bootstrap carousel used to work before but it's no longer working. I can't figure it out what I have done wrong now. I' am loading jQuery on my head and Javascript external files and bootstrap JS in the footer.</p>
  
  <p>I want when the document is loaded / page is loaded the Carousel should auto start. I have tried few options but no luck.</p>
  
  <pre><code>$(function(){
      $('.carousel').carousel({
        interval: 2000
      });
  });
  
  $(function(){
  $('.carousel').carousel({
        interval: 2000
      });
  $('.carousel-control.right').trigger('click');
  });
  </code></pre>
  
  <p><strong>This is the JavaScript which is loaded in the footer.</strong></p>
  
  <pre><code>$("#homeCarousel .item:first").addClass("active");
  $("#homeCarousel .carousel").carousel({interval: 100});
  </code></pre>
  
  <p><strong>This the HTML</strong></p>
  
  <pre><code>&lt;div id="homeCarousel" class="carousel slide visible-lg"&gt;
      &lt;div id="CurrentDemandMeter"&gt;
          &lt;div class="graph"&gt;&lt;?php require_once("snippets/home_current_deman_graph.php"); ?&gt;&lt;/div&gt;
          &lt;div class="graphDeails"&gt;
              &lt;div class="our_current_demand_label"&gt;Our current demand&lt;/div&gt;
              &lt;div class="what_is_this_label"&gt;&lt;a class="what_is_this_link" href="#"&gt;&lt;/a&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- Wrapper for slides --&gt;
      &lt;div class="carousel-inner"&gt;
      &lt;?php
          $i=0;
          $args = array('category_name' =&gt; 'homepage-carousel',);
          $loop = new WP_Query($args);
          while($loop-&gt;have_posts()): $loop-&gt;the_post();
              $link = get_field("learn_more_link", $post-&gt;ID);
              //$link = $meta_values[0];
  
               $args = array(
                 'post_type' =&gt; 'attachment',
                 'numberposts' =&gt; -1,
                 'post_status' =&gt; null,
                 'post_parent' =&gt; $post-&gt;ID
               );
  
                $attachments = get_posts( $args );
                   if ( $attachments ) {
                      foreach ( $attachments as $attachment ) {
                          $attachment = wp_get_attachment_url( $attachment-&gt;ID, 'full' );
      ?&gt;
        &lt;div class="item"&gt;
          &lt;div class="fill"&gt;&lt;img src="&lt;?php echo $attachment; ?&gt;" class="img-responsive"/&gt;&lt;/div&gt;
          &lt;div class="carousel-caption"&gt;
            &lt;h1&gt;&lt;?php echo substr(the_title($before = '', $after = '...', FALSE), 0, 30); ?&gt;&lt;/h1&gt;
            &lt;div class="excerpt"&gt;&lt;?php echo the_excerpt(); ?&gt;&lt;/div&gt;
            &lt;a href="&lt;?php echo $link; ?&gt;" class="btn_learn_more"&gt;&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;?php
                }
           }
          endwhile;
          wp_reset_query();
      ?&gt;               
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>