Quantcast
Viewing latest article 17
Browse Latest Browse All 32

Bootstrap + instafeed.js skipping issue

I have a bootstrap carousel working with instafeed.js. It works, but the issue is that it skips one picture and goes to every odd picture. My code is this:

my instafeed.js:

$(document).ready(function(){
  var feed = new Instafeed({
    clientId: 'CLIENT_ID',
    accessToken:'ACCESS_TOKEN',
    template: '<div class="item"><img src="{{image}}"/></div>',
    resolution: 'standard_resolution',
    get: 'user',
    userId: 2104256781,
    after: function () {
      $('#instafeed > div:nth-child(1)').addClass('active');
    }
  });
  feed.run();
});

and my carousel:

    <div id="myCarousel" class="carousel slide" data-interval="false" data-ride="carousel">
    <div class="carousel-inner" id="instafeed">
    </div>
  </a>
    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

I've looked on stack overflow and people are saying to call $('#myCarousel').carousel();, but I've tried calling it everywhere, yet it doesn't work. Am I missing a place in where to put this? Or is something wrong with my code?


Viewing latest article 17
Browse Latest Browse All 32

Trending Articles