2
我試圖從instagram中拉出圖像並將它們放入Bootstrap3輪播中,以便每個輪播項目包含的是2行6個圖像。jQuery Instagram Bootstrap3動態輪播
我可以把所有的東西都加載得很好,我只是無法將我的頭圍繞邏輯來正確地顯示在傳送帶上的項目。
var userFeed = new Instafeed({
get: 'user',
userId: <?= $user_id ?>,
accessToken: '<?= $access_token ?>',
limit: <?= $num_to_display ?>,
success: function(data) {
$('.carousel').carousel({interval:3000});
// I have tried using .each() too,
// can't break it into chunks that well
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');
}
});
userFeed.run();