GithubHelp home page GithubHelp logo

trungvose / jquery-loading Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 2.0 88 KB

A lightweight library to show a "loading" indicator while element is retrieving from server

Home Page: http://trungk18.github.io/jquery-loading/

License: Apache License 2.0

CSS 80.82% JavaScript 19.18%

jquery-loading's Introduction

jquery-loading

Build Status

Show a "loading" indicator while element (could be text, image and so on) is loading from server

Docs and demo

  1. http://trungk18.github.io/jquery-loading/

  2. http://codepen.io/trungk18/pen/wWoLYR

Getting started

Install it, using Bower:

$ bower install jquery-loading-indicator

Include it:

<!-- jQuery -->
<script src="js/vendor/jquery-3.1.0.min/index.js"></script>
<script src="js/jquery-loading.js"></script>

<!-- Include the CSS file to use the plugin default themes and loaders -->
<link href="css/jquery-loading.css" rel="stylesheet">

Use it:

  • Init loading
$('#loading').loading({ circles: 3 });
  • Hide loading indicator from its container.
$('#loading').loading({ hide: true});
  • Destroy loading indicator from its container from the DOM.
$('#loading').loading({ destroy: true });

Available options

$('#loading').loading({
    overlay: false, // add an overlay background
    width: null, // set fixed width to loading indicator, otherwise calculated relative to element
    indicatorHtml: "<div class='js-loading-indicator' style='display: none;'></div>",
    overlayHtml: "<div class='js-loading-overlay' style='display: none;'></div>",
    base: 0.9, // indicator's width/height relative to element
    circles: 3, // number of indicator circles: maximum is 3
    top: null, //indicator position relative to the top of its container
    left: null, //indicator position relative to the left of its container
    hide: false, // hide the indicator of the current element
    destroy: false //remove the indicator from the DOM
});

jquery-loading's People

Contributors

trungvose avatar

Stargazers

 avatar Pham Duc Manh avatar Koray Kavruk avatar 火星小刘 avatar Marc avatar  avatar Phuong Tran avatar

Watchers

James Cloos avatar  avatar ヒエウ (Hieu) avatar  avatar

jquery-loading's Issues

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.