$(document).ready(function() {
    $("#howtouse").truncate({max_length: 9 + $("#howtouse").text().indexOf('.', $("#howtouse").text().indexOf('.') + 1), more: 'more'});
    // truncate() adds a hidden <div> to store the truncated/non-truncated code, so it's important to only traverse the visible divs.
    $.each($("#video div:visible"), function() { 
        var text = $(this).find("p:first").text();
        var endOfSentence = text.indexOf('.') != -1 ? text.indexOf('.') : text.indexOf('!');
        $(this).truncate({max_length: 10 + endOfSentence, more: 'more'});
    });
    $("#video div:hidden").css("height", "auto");
});

