Coder Social home page Coder Social logo

jquery-loading-overlay's Introduction

Loading Overlay

Build Status Built with Grunt

jQuery Loading Overlay Plugin

Uses Javascript to add/remove a loading overlay to a target element. It can be called on any element that should receive the loading overlay, and accepts options for class selectors and loading overlay text. The overlay itself must be styled via CSS.

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/loading-overlay.min.js"></script>
<script>
jQuery(function($) {
  // Calling the plugin
  // (prepends a div.loading to the target element)
  $('#target').loadingOverlay();

  // Removing the loading overlay
  $('#target').loadingOverlay('remove');
});
</script>

Demo

See a working example of the loading-overlay in action, both with and without CSS styling.

Documentation

Available options, explictly set to their defaults:

$('#target').loadingOverlay({
  loadingClass: 'loading',          // Class added to target while loading
  overlayClass: 'loading-overlay',  // Class added to overlay (style with CSS)
  spinnerClass: 'loading-spinner',  // Class added to loading overlay spinner
  iconClass: 'loading-icon',        // Class added to loading overlay spinner
  textClass: 'loading-text',        // Class added to loading overlay spinner
  loadingText: 'loading'            // Text within loading overlay
});

NOTE: If loadingClass or overlayClass options are passed when initializing the loading overlay, the same options must be passed when removing that overlay:

$('#target').loadingOverlay('remove', {
  loadingClass: 'loading',
  overlayClass: 'loading-overlay'
});

Release History

  • 1.0.2 - (02/19/2014) Add bower.json
  • 1.0.1 - (10/13/2013) Don't allow duplicate loading-overlays
  • 1.0.0 - (10/11/2013) Initial release

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.