Git Product home page Git Product logo

js_loader's Introduction

JS Loader

JS Loader is a lightweight jQuery plugin written by Berka Ayowa that helps you create an animated spinner with a fullscreen loading mask

To use it you just have to include jQuery and a copy of JS Loader plugin in your head or footer:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="../loader.js"></script>

Properies

Attribute Description Example Default Value
gifUrl Url for a spinner gif image. "./images/loader.gif" NULL
bgRgab Background color in Rgab format. 'rgba(53, 53, 53, 0.8)' 'rgba(53, 53, 53, 0.8)'
color Loading Text color. '#eaeaea' 'White'
message Loading Text 'Please waite' 'Loading...'

Events

Event Description
onStartLoading Fires when loading starts
onFinishLoading Fires when loading starts

Methds

Methd Description
show To start showing loader
hide To stop showing loader
setMessage To set loading text
setHtmlMessage To set loading text as html element

Basic Initialize

$('#loader').loader();

Initialize with options

$('#loader').loader({
    gifUrl: "./images/loader.gif",
    bgRgab:'rgba(53, 53, 53, 0.8)',
    color:'white'
});

Initialize with options and events

$('#loader').loader({
    gifUrl: "./images/loader.gif",
    bgRgab:'rgba(53, 53, 53, 0.8)',
    color:'white',
    onStartLoading: function() {
        console.log("started loading");
    },
    onFinishLoading: function() {
        console.log("Finished loading");
    }
});

Method calls

$('#loader').loader('setMessage', 'Please waite');
$('#loader').loader('setHtmlMessage', '<h1>Waiting..</h1>');

Show/Start loading (Method)

$('#loader').loader('show');

Hide/Stopt loading (Method)

$('#loader').loader('hide');

Demo

Source code for this demo is under example/index2.html

js_loader's People

Contributors

berkaayowa avatar

Watchers

 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.