mardi 7 juillet 2015

Add property to instance of instafeed.js?

I have a website siavoush-re.co.uk which is linked to my Instagram account using Instafeed.js. To use instafeed.js I have to create a new instance of it with properties of my choosing. I am trying to add a property to the instance depending on the screen size using an if statement, here is what I have done so far,

var feed = new Instafeed({
    get: 'user',
    userId: private,
    limit: 21,
    accessToken: 'private',

});

if (document.documentElement.clientWidth > 600 ) {
    feed.resolution = 'low_resolution';
};

feed.run();

I am new to javascript, what would be the correct implementation?

Aucun commentaire:

Enregistrer un commentaire