# Ladda for Bootstrap 3
Buttons with built-in loading indicators, effectively bridging the gap between action and feedback.
[Check out the demo page](http://msurguy.github.io/ladda-bootstrap/).
## 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.
```html
<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](http://lab.hakim.se/ladda/) *[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](http://css-tricks.com/snippets/css/named-colors-and-hex-equivalents/).
#### 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:
```javascript
// 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:
```javascript
// Create a new instance of ladda for the specified button
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:
```javascript
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
没有合适的资源?快使用搜索试试~ 我知道了~
Ladda for Bootstrap 3按钮加载插件
共25个文件
js:8个
css:5个
json:3个
需积分: 10 10 下载量 104 浏览量
2014-07-09
13:26:33
上传
评论
收藏 34KB ZIP 举报
温馨提示
Ladda可以让你点击按钮时,在按钮中显示一个加载进度效果。浏览器要求ie8以上版本,演示地址:http://www.jq22.com/jquery-info502
资源推荐
资源详情
资源评论
收起资源包目录
jquery-ladda-bootstrap-master.zip (25个子文件)
ladda-bootstrap-master
.gitignore 27B
package.json 786B
www.jq22.com.txt 111B
Gruntfile.js 2KB
dist
ladda.min.js 2KB
ladda.js 6KB
ladda.min.css 9KB
ladda.css 12KB
spin.js 8KB
spin.min.js 4KB
ladda-themeless.css 10KB
ladda-themeless.min.css 7KB
LICENSE 1KB
js
ladda.js 6KB
prism.js 7KB
spin.js 10KB
.DS_Store 6KB
css
ladda.scss 8KB
ladda-theme.scss 1KB
prism.css 2KB
README.md 2KB
index.html 8KB
params.json 234B
jquery插件库.url 119B
bower.json 510B
共 25 条
- 1
资源评论
jquery插件库-jq22com
- 粉丝: 14
- 资源: 301
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功