Bootstrap 文件上传插件Filestyle的用法
2014-12-29 20:38
302 查看
本文转自:http://markusslima.github.io/bootstrap-filestyle/
Get Bootstrap Filestyle
Project on Github Productionversion Development version
Browser Support
Suport IE 8+
Description
The Bootstrap Filestyle is a plugin for jquery-based component library could Twitter Bootstrap, used to style the file fields of the forms.This plugin has an interesting way to present a form for sending files so attractive, while being simple and efficient.
Requirements
Twitter Bootstrap and jQuery.
Get Start
Include:<script type="text/javascript" src="js/bootstrap-filestyle.min.js"> </script>
Via JavaScript:
$(":file").filestyle();
Via data attributes:
<input type="file" class="filestyle">
Options
input
- Enables or disables the input text. Type: Boolean, Default: true
Via JavaScript:$(":file").filestyle({input: false});
Via data attributes:
<input type="file" class="filestyle" data-input="false">
Example:
Choose file
icon
- Enables or disables the button icon. Type: Boolean, Default: true
Via JavaScript:$(":file").filestyle({icon: false});
Via data attributes:
<input type="file" class="filestyle" data-icon="false">
Example:
Choose
file
buttonText
- Changes the button text. Type: String, Default: "Choose file"
Via JavaScript:$(":file").filestyle({buttonText: "Find file"});
Via data attributes:
<input type="file" class="filestyle" data-buttonText="Find file">
Example:
Find
file
buttonName
- Change classes bootstrap button. Type: String, Default: "btn-default"
Via JavaScript:$(":file").filestyle({buttonName: "btn-primary"});
Via data attributes:
<input type="file" class="filestyle" data-buttonName="btn-primary">
Example:
Choose
file
size
- Change size bootstrap of the button and input. Type: String, Default: "nr"
Accepted values: lg, nr, smVia JavaScript:
$(":file").filestyle({size: "sm"});
Via data attributes:
<input type="file" class="filestyle" data-size="sm">
Example:
Choose
file
iconName
- Change classes bootstrap icons. Type: String, Default: "glyphicon-folder-open"
Via JavaScript:$(":file").filestyle({iconName: "glyphicon-inbox"});
Via data attributes:
<input type="file" class="filestyle" data-iconName="glyphicon-inbox">
Example:
Choose
file
disabled
- Disabled button. Type: Bool, Default: false
Via JavaScript:$(":file").filestyle({disabled: true});
Via data attributes:
<input type="file" class="filestyle" data-disabled="true">
Example:
Choose
file
buttonBefore
- Button before. Type: Bool, Default: false
Via JavaScript:$(":file").filestyle({buttonBefore: true});
Via data attributes:
<input type="file" class="filestyle" data-buttonBefore="true">
Example:
Choose
file
badge
- Enables or disables the badge counter. Type: Boolean, Default: true
Via JavaScript:$(":file").filestyle({badge: false});
Via data attributes:
<input type="file" class="filestyle" data-badge="false">
Example:
Choose file
Methods
clear
- Clear selected files.
$(":file").filestyle('clear');
destroy
- Destroy a filestyle completely.
$(":file").filestyle('destroy');
disabled
- Disabled a filestyle.
// get $(":file").filestyle('disabled'); // set $(":file").filestyle('disabled', true);
input
- Set or get the value of the input option.
// get $(":file").filestyle('input'); // set $(":file").filestyle('input', false);
icon
- Set or get the value of the icon option.
// get $(":file").filestyle('icon'); // set $(":file").filestyle('icon', false);
buttonText
- Set or get the text of the button.
// get $(":file").filestyle('buttonText'); // set $(":file").filestyle('buttonText', 'Loading...');
buttonName
- Set or get the class of the button.
// get $(":file").filestyle('buttonName'); // set $(":file").filestyle('buttonName', 'btn-danger'};
iconName
- Set or get the class of the icon.
// get $(":file").filestyle('iconName'); // set $(":file").filestyle('iconName', 'glyphicon-home');
size
- Set or get the class of the input text.
// get $(":file").filestyle('size'); // set $(":file").filestyle('size', 'lg');
buttonBefore
- Set or get button position.
// get $(":file").filestyle('buttonBefore'); // set $(":file").filestyle('buttonBefore', 'true');
相关文章推荐
- 基于BootStrap Metronic开发框架经验小结【五】Bootstrap File Input文件上传插件的用法详解
- 基于BootStrap Metronic开发框架经验小结【五】Bootstrap File Input文件上传插件的用法详解
- SWFUpload文件上传插件用法详解
- bootstrap 文件上传插件 fileinput.min.js 可以预览图片
- 基于Bootstrap 3可预览的HTML5文件上传插件
- 文件上传预览插件 Bootstrap-fileinput组件封装及使用
- 基于Metronic的Bootstrap开发框架经验总结(5)--Bootstrap文件上传插件File Input的使用
- Bootstrap文件上传插件File Input的使用
- Bootstrap的fileinput插件实现多文件上传的方法
- Bootstrap文件(图片)上传插件File Input进阶使用说明
- 基于Metronic的Bootstrap开发框架经验总结(5)--Bootstrap文件上传插件File Input的使用
- php 应用 bootstrap-fileinput 上传文件 插件 操作的方法
- 基于Metronic的Bootstrap开发框架经验总结(5)--Bootstrap文件上传插件File Input的使用
- bootstrap-fileinput 插件使用总结(最近做项目应用到了这个上传文件的插件,分享下不够完善请指出共同进步)
- Bootstrap -- 文件上传插件File Input的使用
- 基于Metronic的Bootstrap开发框架经验总结(5)--Bootstrap文件上传插件File Input的使用
- Bootstrap文件上传插件File Input的使用
- 支持多文件上传,预览,拖拽,基于bootstrap的上传插件fileinput的ajax异步上传
- Bootstrap文件上传插件File Input的使用
- 支持多文件上传,预览,拖拽,基于bootstrap的上传插件fileinput 的ajax异步上传(转载)