浅谈webuploader上传文件
2024-08-30 18:53:18
官网:http://c7.gg/fw4sn
案例:
文件上传进度
// 文件上传过程中创建进度条实时显示。
uploader.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
})
文件成功、失败处理
uploader.on( 'uploadSuccess', function( file ) {
$( '#'+file.id ).find('p.state').text('已上传');
});
uploader.on( 'uploadError', function( file ) {
$( '#'+file.id ).find('p.state').text('上传出错');
});
uploader.on( 'uploadComplete', function( file ) {
$( '#'+file.id ).find('.progress').fadeOut();
});
最新文章
- Linux的tmpfs文件系统
- php的两个符号@和&;---php总会要知道的系列
- The error occurred while setting parameters 错误解析--Bad value for type timestamp : 3
- Oracle下的IF EXISTS()
- 【android】android中activity的生命周期
- android 基础学习图片六progross
- Cloudera Manager、CDH零基础入门、线路指导 http://www.aboutyun.com/thread-9219-1-1.html (出处: about云开发)
- Android网络:开发浏览器(二)——功能完善之长按网页图片菜单
- java学习笔记-Thread
- jquery validation remote depends 验证触发条件
- int装箱比较
- Plupload上传插件简单整理
- IDEA XML注释与取消注释快捷键
- Linux退出状态码
- ros 使用笔记
- spring security 4.2后出现CouldnotverifytheprovidedCSRFtokenbecauseyoursessionwasnotfound
- Lua面向对象 --- 封装
- firedac引擎DATASNAP多表查询和多表提交
- 鼠标不能用怎么办 USB OPTICAL MOUSE
- CentOS7 上systemctl