Generate Lorem Ipsum In Any Container - jQuery Lorem.js

File Size: 3.62 KB
Views Total: 1127
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Generate Lorem Ipsum In Any Container - jQuery Lorem.js

A really simple and super light jQuery Lorem Ipsum generator that lets you generate placeholder text of a specified length in any container element such as DIV, paragraph, textarea, etc.

How to use it:

1. Place the minified version of the jQuery Lorem.js plugin after jQuery JavaScript library.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<script src="jquery.lorem.js"></script>

2. Call the function on the target container element and done.

<h2></h2>
<div></div>
<p></p>
<textarea></textarea>
$('h2, div, p, textarea').Lorem();

3. Specify the text length you want to generate.

$('h2').Lorem({
  "length" : "one"
});

$('div').Lorem({
  "length" : "two"
});

$('p').Lorem({
  "length" : "three"
});

$('textarea').Lorem({
  "length" : "full"
});

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