Lorem Text And Placeholder Image Generator In Pure JavaScript – Lorem.js

Category: Image , Javascript , Text | June 14, 2017
Author: f
Views Total: 1,772
Official Page: Go to website
Last Update: June 14, 2017
License: MIT

Preview:

Lorem Text And Placeholder Image Generator In Pure JavaScript – Lorem.js

Description:

Just another JavaScript library that randomly generates Lorem Ipsum text and Dummy Images for use as placeholders in documents.

How to use it:

Download the insert the JavaScript file ‘lorem.js’ into the document.

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

Setup the number of paragraphs, sentences, words to generate using ‘data-lorem’ attributes as follows:

<div data-lorem="3p">
  ... 3 paragraphs ...
</div>

<div data-lorem="10s">
  ... 10 sentences ...
</div>

<div data-lorem="140w">
  ... 140 words ...
</div>

<div data-lorem="10-140w">
  ... 10 - 140 words ...
</div>

You’re also able to generate placeholder images based on lorempixel.com.

<img src="" data-lorem="sports/1/your message">
<img src="" data-lorem="gray">
<img src="" data-lorem="gray abstract">

You Might Be Interested In:


Leave a Reply