Quantcast
Viewing all articles
Browse latest Browse all 32

Instafeed.js and jQuery colorbox

I'm trying to set the jQuery Colorbox on the Instafeed.js images. Both of the scripts work fine separately, but whenever I try to set the colorbox class to an element inside the Instafeed.js template part, Colorbox doesn't work anymore.

However, Colorbox is working correctly outside the Instafeed script, either with the Colorbox class set to an <a> or <img>.

Instafeed

var userFeed = new Instafeed({
      get: 'user',
      userId: ,
      limit: 20,
      accessToken: '',
      resolution: 'standard_resolution',
      template: '<a href="{{model.images.standard_resolution.url}}" class="box"><img src="{{image}}" /></a>',
    });
    userFeed.run();

Colorbox

$(document).ready(function(){
            $(".box").colorbox({transition:"fade"});
        });

There was the same issue here : https://github.com/stevenschobert/instafeed.js/issues/198 but the solution given didn't work for some reasons. With this solution, nothing happens when I click on an image. With my previous code, shown on the post, it opened the image in a different window.

Is there a specific thing to do to set Colorbox into Instafeed ? I've tried everything I could, and there's not much about it online.


Viewing all articles
Browse latest Browse all 32

Trending Articles