Hi I got a template for instafeed and now I need to limit the length of the caption. I added to js code to do it but it does not work. Is there a way to make the <p><i>{{caption}}</i></p>
shorter and add ellipsis.
Here is my code:
$(function(){
$(".caption").each(function(i){
len=$(this).text().length;
if(len>10)
{
$(this).text($(this).text().substr(0,10)+'...');
}
});
});
/* Intafeed and SimplyScroll */
var feed = new Instafeed({
target: 'instagram-list',
get: 'user',
userId: 1713392078,
accessToken: '0000000',
clientId: '0000000',
limit: '30',
sortBy: 'most-recent',
link: 'true',
template: '<li><figure class="effect-honey background-black1"><figcaption><p><i class"caption">{{caption}}</i></p></figcaption><a href="{{link}}" target="_blank"><img src="{{image}}" alt"{{caption}}"/></a><span class="instagram-metadata shadow">{{likes}} <span class="instagram-like"></span></span></figure></li>',
resolution: 'low_resolution',
after: function() {
$("#instagram-list").simplyScroll({
speed: 1,
frameRate: 24,
orientation: 'horizontal',
direction: 'forwards',
})
}
})
feed.run();