Giter Site home page Giter Site logo

blackthorns / jquery.loader.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from monkeymonk/jquery.loader.js

0.0 2.0 0.0 148 KB

Display a loader on your page or HTML block element.

Home Page: http://monkeymonk.github.com/jquery.loader.js/

License: BSD 3-Clause "New" or "Revised" License

jquery.loader.js's Introduction

jQuery.loader Plugin - v 1.0

Display a loader on your page or HTML block element.

Project site: http://monkeymonk.github.com/jquery.loader.js/

Demo: http://monkeymonk.be/jquery.loader.js/demo/

Usage

Basic

First of all, include jquery.loader.js (1.526 kb), jquery.loader.min.css (1.135 kb) and loader.gif (3.866 kb) in your HTML then start to use jQuery.loader.

$(document).ready(function() {
    $('body').loader('show');

    setTimeout(function () {

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

    }, 2000);
});

Options

{
    className: 'loader',

    tpl: '<div class="{className} hide"><div class="{className}-load"></div><div class="{className}-overlay"></div></div>',

    delay: 200,
    loader: true,       // if true, you can hide the loader by clicking on it
    overlay: true,      // display or not the overlay

    // Callback
    onHide: function () {},
    onShow: function () {}
}

Methods

jQuery().loader('show', options);

jQuery.loader use a tiny template system that let you an easy way to customize your loader.

$('body').load('show', {
    onHide: function () {
        // do something...
    }
});

jQuery().loader('hide', onHide);

Hide the loader

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

Browsers: Tested and Working In

  • IE 6, 7, 8, 9, 10
  • Firefox 3+
  • Opera 10+
  • Safari 4+

jquery.loader.js's People

Watchers

James Cloos avatar Studio Blackthorns 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.