This time I will share jQuery Plugin and tutorial about jQuery Plugin For Collapsible Html List – showmore.js, hope it will help you in programming stack.
showmore.js is a jQuery plugin which truncates your multi-line content into a collapsible list with ‘Show more’ and ‘Show less’ links.
How to use it:
1. First you need to load jQuery library and the jQuery showmore.js plugin before the closing body tag.
1 |
< script src = "//code.jquery.com/jquery.min.js" ></ script > |
2 |
< script src = "dist/jquery.showmore.js" ></ script > |
2. Call the showmore
function on the html list and specify how many items to be shown.
3. You can also apply the plugin to any html element like divs.
4. Customize the ‘Show more’ and ‘Show less’ links.
3 |
showMoreText : "<span>+ Show more</span>" , |
4 |
showLessText : "<span>- Show less</span>" , |
5 |
showMoreClass : "show_more" , |
6 |
showLessClass : "show_less" |
This awesome jQuery plugin is developed by xmaestro. For more Advanced Usages, please check the demo page or visit the official website.