I'm using the Bootstrap 3 carousel for my Rails 4 application. To truncate longer captions in the carousel, I'm using the jquery dotdotdot plugin which also appends "..." at the end. While the plugin works for the first image in the carousel, it doesn't work for subsequent images.
Here's the jsfiddle: http://jsfiddle.net/michaelvli/GD3JH/9/
Why is dotdotdot not executing on all captions of the carousel? I've tried using a carousel event handler to execute the plugin every time the carousel slides but this solution isn't suitable as the user will see the full caption for a brief moment before dotdotdot has had a chance to execute:
$('.carousel').on('slide.bs.carousel', function () {
$('.dotdotdot').dotdotdot({});
});
Alternatively, if somebody can recommend another solution that truncates multi-line captions while appending a "..." to the end, that would be great too.