jquery-loadmask-plus

WebJar for jquery-loadmask-plus

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-robcalcroft-jquery-loadmask-plus
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

jquery-loadmask-plus
WebJar for jquery-loadmask-plus
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/robcalcroft/jquery-loadmask-plus

Download github-com-robcalcroft-jquery-loadmask-plus

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-robcalcroft-jquery-loadmask-plus/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-robcalcroft-jquery-loadmask-plus</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-robcalcroft-jquery-loadmask-plus/
implementation 'org.webjars.npm:github-com-robcalcroft-jquery-loadmask-plus:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-robcalcroft-jquery-loadmask-plus/
implementation ("org.webjars.npm:github-com-robcalcroft-jquery-loadmask-plus:1.0.0")
'org.webjars.npm:github-com-robcalcroft-jquery-loadmask-plus:jar:1.0.0'
<dependency org="org.webjars.npm" name="github-com-robcalcroft-jquery-loadmask-plus" rev="1.0.0">
  <artifact name="github-com-robcalcroft-jquery-loadmask-plus" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-robcalcroft-jquery-loadmask-plus', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-robcalcroft-jquery-loadmask-plus" % "1.0.0"
[org.webjars.npm/github-com-robcalcroft-jquery-loadmask-plus "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

jquery-loadmask-plus

Build Status

A fork of jquery-loadmask which intends to modernise the look and feel of the original plugin by way of CSS updates and improved API usage.

The source code was exported to GitHub from Google Code

My additional functionality is noted in the original README document from the original repository along with some edits (shown below).

####Project installation

  • Download the release .zip
  • Use the hosted version:
//cdn.calcroft.co/jquery.loadmask-plus.min.js
//cdn.calcroft.co/jquery.loadmask-plus.min.css

####Development install

  1. Get the source code git clone https://github.com/robcalcroft/jquery-loadmask-plus.git
  2. Install Ruby
  3. Install Compass gem update --system && gem install compass
  4. Install dependancies npm install gulp jshint -g && npm install
  5. Build out the source gulp

####Notes

  • Only use this on container elements; I have found that this does not play well with padding and causes an offset on the text.

LoadMask jQuery plugin can mask DOM elements while their content is loading or changing to prevent user interactions and inform that some background task is still running. It is very light (~2Kb) and easy to use.

The behavior of this plugin is largely based on handy Element.mask() method from ExtJS Framework.

#Usage jQuery version required: > 1.2.3.

Please note that only elements that accept child nodes can be masked.

To start using the plugin you need to include jquery.loadmask.css and jquery.loadmask.js (or its minified version jquery.loadmask.min.js) to your html page:

<link rel="stylesheet" type="text/css" href="//cdn.calcroft.co/jquery.loadmask-plus.min.css" />
<script type="text/javascript" src="//cdn.calcroft.co/jquery.loadmask-plus.min.js"></script>

##Masking To put a mask over an element (or multiple elements) simply call mask(options) method :

$("#myDiv").mask() // Will show the loading animation in white

$("#myDiv").mask({
  iconColour: "red" // Updates the colour of the loading animation
});

// Alternatively, specify a label to be shown instead of the icon
$("#myDiv").mask({
  label: "Loading",
  delay: 500
});

###Options can be:

  • iconColour
  • bgColour
  • delay
  • label

The delay property sets a delay in milliseconds before element(s) is masked. If unmask() is called before the delay times out, no mask is displayed. This can be used to prevent unnecessary mask display for quick processes.

Note that the if the label property is set the icon will not be shown

##Unmasking To remove a previously displayed mask from an element (or multiple elements) call unmask() without any parameters:

$("#mydiv").unmask();

Calling unmask() on a delayed mask prevents it from showing up.

##Checking if an element is masked

You can use isMasked() method on a single element to check if it is currently masked. Please note that this method will return false whilst mask is delayed.

if($("#mydiv").isMasked()) { ... }

#Integration with ASP.net UpdatePanel Please take a look at this code.

#Integration with Jquery UI Please take a look at this code.

#Contributors

  • wpaap - provided snapshot for integration with ASP.net UpdatePanel
  • Artur Alexandre Moreira ([email protected]) - implemented delayed mask
  • theonlylawislove - provided Jquery UI integration solution

Thank you!


Thanks to Sergiy for the creation of this plugin!

Versions

Version
1.0.0