JQUERY READ MORE “TEXT ABBREVIATOR” PLUGIN

If you have a lot of user-generated content that you don’t limit the length on, so it can grow very large. To combat this, there is the UI pattern: a “read more” link available to show the remaining text for the long-winded texts, while just showing a snippet otherwise. Jquery.readmore is an easy way to do this.

Default Usage

<p class="short">
  (long text here)
</p>
$(".short").readmore();

Resulting Demo

Setting substring length

<p class="short">
  (long text here)
</p>

// adjust per call
$(".short").readmore({ substr_len: 50 });

// or permanently for all calls
$.fn.readmore.defaults.substr_len = 50;
$(".short").readmore();

This delimits the text shown to 50 characters, and is appended with the read more tag.

Site Help
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.