jQuery Plugin For Collapsable Paragraphs - Hide Paragraphs

File Size: 4.78KB
Views Total: 2684
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin For Collapsable Paragraphs - Hide Paragraphs

Hide Paragraphs is a small and easy-to-use jQuery plugin for collapsable paragraphs that automatically adds link to show or hide more paragraphs. By default, the plugin will only show the first paragraph of your content, and you can customize the number in the options.

See also:

How to use it:

1. Include jQuery javascript library and jQuery Hide Paragraphs Plugin on the web page

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="hide_paragraphs.js"></script>

2. The html

<div class="collapsable">
<p>Paragraph 1</p>
<p>Paragraph 2</p>
...
</div>

3. Call the plugin with options

<script>
$(function () {
$(".collapsable").hideParagraphs({
show: 1,
show_text: "Show more",
hide_text: "Hide"
});
});
</script>

This awesome jQuery plugin is developed by manuca. For more Advanced Usages, please check the demo page or visit the official website.