Easy Lorem Ipsum Text Generator With Pure JavaScript – lorem-js

Category: Javascript , Recommended , Text | September 25, 2016
Author:ramachandrajr
Views Total:2,105 views
Official Page:Go to website
Last Update:September 25, 2016
License:MIT

Preview:

Easy Lorem Ipsum Text Generator With Pure JavaScript – lorem-js

Description:

Lorem JS is an easy to use Javascript library which helps include Lorem Ipsum text. All of this done just by using just the Class Names.

How to use it:

Just include the core JavaScript file lorem.js on the webpage and you’re ready to go.

<script src="lorem-js/lorem.js"></script>

Always Use the class name lo or lorem wherever you need lorem.js to output a paragraph for you. You can use any one of them. After the initial class you have to add amongst the choices:

  1. xs – Two words
  2. sm – Twenty words
  3. md – Seventy words
  4. lg – Two Hundred words
  5. xl – Three Fifty words
  6. someNumber – Some number of words

These classes work on the following html tags only. If the class is being used on any other tags, it will result in a console.error message displayed in your developer console and lorem.js will not work on that tag.

  1. <p> – Paragraph tags
  2. <span> – Span tags
  3. <h1> through <h6> – Heading tags
  4. <div> – Can be used on a div tag for creating multi-paragraphed lorem ipsum
<p class="lorem sm"></p>
<p class="lo sm"></p>
<p class="lorem 123"></p>
<div class="lorem 9 39"></div>
<div class="lorem numParagraphs - 1 numwords/paragraph - 1"></div>

You Might Be Interested In:


Leave a Reply