Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Latest commit

 

History

History
23 lines (19 loc) · 783 Bytes

README.md

File metadata and controls

23 lines (19 loc) · 783 Bytes

jquery-px-readmore

Just another jQuery Readmore plugin for collapsing and expanding long blocks of text with "Read more" and "Read less" buttons. It's a drop-in solution you can probably use with your existing HTML. There's no need for complicated sets of div's or smth smth. You can use this plugin purely through the markup API without writing a single line of JavaScript.

How to use?

<article data-readmore-max-height="200" data-readmore="Read more" data-readmore-less="Read less">
...
</article>

Events

$(document).on('closed.px.readmore', function(e) {
  var $this = $(e.relatedTarget); // Toggle button element
});

$(document).on('open.px.readmore', function(e) {
  var $this = $(e.relatedTarget); // Toggle button element
});