How to expand truncated text onclick by using dotdotdot?

前端 未结 1 360
花落未央
花落未央 2021-01-14 05:00

I am using the jQuery dotdotdot truncation plugin dotdotdot.frebsite.nl

I want to truncate at max 2 lines. And when a user clicks on more,

相关标签:
1条回答
  • 2021-01-14 05:20

    You can send a destroy message to dotdotdot

    $('a.read-more').on( 'click', function(event) {
        event.preventDefault();
        $(this).parent().trigger("destroy");
    });
    

    http://jsfiddle.net/bhlaird/C5Ent/

    0 讨论(0)
提交回复
热议问题