GithubHelp home page GithubHelp logo

antrepo / loremjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from f/loremjs

0.0 1.0 0.0 160 KB

Lorem.js Dummy Text/Image Generator for jQuery and Native JS

License: GNU Lesser General Public License v3.0

HTML 100.00%

loremjs's Introduction

Lorem.js Dummy Text/Image Generator jQuery and Native JS

A Lorem Ipsum creator service written on JavaScript.

Implementation

Implementation of Lorem.js is so simple,

You just download and add

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

into your website/application and run.

If you want to put a lorem text inside a DIV (etc.) tag just write:

<div data-lorem="2p"></div>

If you want a random length of lorem text within a range just write:

<div data-lorem="2-4p"></div>

Querying

Lorem.js has a simple query language: "how many?, what?"

2p = 2 paragraphs
5s = 5 sentences
6w = 6 words
1-6w = between 1 and 6 words

That's it.

Dummy Images

And Lorem.js uses lorempixum.com for images for now.

Usage:

<img src="" data-lorem="sports/1/Test message" width="223" height="223">
<img src="" data-lorem="gray" width="100" height="124">
<img src="" data-lorem="gray animals" width="100" height="124">

And watch what happens :)

Native JavaScript (without any framework)

If you want to use Lorem generator natively, (without jQuery).

With Native support, you can lorem.js into your framework.

Usage:

var lorem = new Lorem;
lorem.type = Lorem.TEXT;
lorem.query = '2p';
lorem.createLorem(document.getElementById('lorem'));

Feel free to ask questions.

loremjs's People

Contributors

la-drone avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.