ladda-bootstrap

WebJar for ladda-bootstrap

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

ladda-bootstrap
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

ladda-bootstrap
WebJar for ladda-bootstrap
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/msurguy/ladda-bootstrap

Download ladda-bootstrap

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/ladda-bootstrap/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>ladda-bootstrap</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/ladda-bootstrap/
implementation 'org.webjars.bower:ladda-bootstrap:0.1.0'
// https://jarcasting.com/artifacts/org.webjars.bower/ladda-bootstrap/
implementation ("org.webjars.bower:ladda-bootstrap:0.1.0")
'org.webjars.bower:ladda-bootstrap:jar:0.1.0'
<dependency org="org.webjars.bower" name="ladda-bootstrap" rev="0.1.0">
  <artifact name="ladda-bootstrap" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='ladda-bootstrap', version='0.1.0')
)
libraryDependencies += "org.webjars.bower" % "ladda-bootstrap" % "0.1.0"
[org.webjars.bower/ladda-bootstrap "0.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : bootstrap jar [3.0.0,)
org.webjars.bower : spin.js jar [1.3.2,1.4)

Project Modules

There are no modules declared in this project.

Project INACTIVE

There is now no need to maintain this project as Ladda operates well on its own with Bootstrap and demo pages could be found in the original Ladda repository: https://github.com/hakimel/Ladda/tree/master/test

Ladda for Bootstrap 3

Buttons with built-in loading indicators, effectively bridging the gap between action and feedback.

Check out the demo page.

Instructions

Please see the demo page for the details: (http://msurguy.github.io/ladda-bootstrap/).

HTML

Ladda buttons must be given the class ladda-button and the button label needs to have the ladda-label class. The ladda-label will be automatically created if it does not exist in the DOM. Below is an example of a button which will use the expand-right animation style.

<button class="ladda-button" data-style="expand-right"><span class="ladda-label">Submit</span></button>

Buttons accepts three attributes:

  • data-style: one of the button styles, full list in demo [required]
  • data-color: green/red/blue/purple/mint
  • data-size: xs/s/l/xl, defaults to medium
  • data-spinner-size: 40, pixel dimensions of spinner, defaults to dynamic size based on the button height
  • data-spinner-color: A hex code or any named CSS color.

JavaScript

If you will be using the loading animation for a form that is submitted to the server (always resulting in a page reload) you can use the bind() method:

// Automatically trigger the loading animation on click
Ladda.bind( 'input[type=submit]' );

// Same as the above but automatically stops after two seconds
Ladda.bind( 'input[type=submit]', { timeout: 2000 } );

If you want JavaScript control over your buttons you can use the following approach:

// Create a new instance of ladda for the specified button
// Please note that this must be done after the button has been
// added to the DOM.
var l = Ladda.create( document.querySelector( '.my-button' ) );

// Start loading
l.start();

// Will display a progress bar for 50% of the button width
l.setProgress( 0.5 );

// Stop loading
l.stop();

// Toggle between loading/not loading states
l.toggle();

// Check the current state
l.isLoading();

All loading animations on the page can be stopped by using:

Ladda.stopAll();

Browser support

The project is tested in Chrome and Firefox. It Should Work™ in the current stable releases of Chrome, Firefox, Safari as well as IE9 and up.

License

MIT licensed

Copyright (C) 2013 Hakim El Hattab, http://hakim.se

Versions

Version
0.1.0