I am using instafeedjs to display the pictures on a site. I am trying to add Bootstrap 3 carousel by following link.
- http://www.tutorialrepublic.com/codelab.php?topic=bootstrap&file=carousel-methods.
When I run the code it displays nothing.
<script type="text/javascript">
var feed = new Instafeed({
get: 'tagged',
tagName: '****',
clientId: '*************',
limit: 20,
sortBy: 'most-recent',
template: '<div class="item"><img src="{{image}}"/></div>',
success: function (data) {
$('.carousel').carousel({ interval: 3000 });
for (var i = 0; i < $(data.data).size() ; i++) {
$('.carousel-inner').append('<div class="item"></div>');
$('.item').append('<div class="col-sm-2 instagram- placeholder"><img src=' + data.data[i].images.standard_resolution.url + ' class="img-responsive"></div>');
}
$('.carousel').carousel('next');
},
after: function () {
$('#instafeed > div:nth-child(1)').addClass('active');
}
});
feed.run();
</script>
Here is the HTML:
<div id="carousel" class="carousel slide" data-interval="false">
<div class="carousel-inner" id="instafeed"></div>
</div>
Here is the code that supports carousel on loaded feeds. The number of image is limited the the value set by the instafeed property 'limit' and the carousel runs infinitely.
HTML
JavaScript
Find the working demo here