The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to animate truncated text

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #161274

    I’m using the jQuery dotdotdot 1.6.12 plugin to add an ellipsis to truncated text. You can see it on this page by clicking any of the ‘EN SAVOIR PLUS’ buttons under ‘COMP√ČTENCES’

    I use the below code to add the ellipsis:

    $(".truncate-wrap article").click(function(event) {
            if ($(this).hasClass("truncated")) {
                $(this).find(".truncate-text").css({'height': 'auto', 'margin-bottom': '0'});
            } else {
                $(this).find(".truncate-text").css({'height': '80px', 'margin-bottom': '20px'});

    How can I animate the transition to slide up/down (like a jquery toggle for example) when the full text is shown/truncated?


Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.