0

I'm using Readmore.js plugin and it's working well, but how it's expectable, isn't working on ajax loaded content.

this is the code I'm using to expand text inside a <p class="long-text">Text here</p>

$('.long-text"').readmore({
      speed: 75,
      lessLink: '<a href="#">Read less</a>'
    });

I'm figuring out I have to do something like this, but don't know which class have I to target:

`$(document.body).on('click', '.someclass', function()` {
  /// readmore function here ///

1 Answers1

0

As ajax file is standalone file, you need to include readmore.js in ajax file and assign readmore functions to your elements. Don't forget to include jQuery js also

user3045457
  • 164
  • 1
  • 3
  • 12