SWFUpload flash文件上传使用集锦
2014-02-27 09:23
627 查看
1)、重写事件:
$.fn.imgbox = function(v) {
var s = {
key: '',
url: '',
source: [],
max: 0,
type: 'default',
button: 'swfUploadImageHolder',
hdkey: '',
imgurl :'/images/upload.gif'
};
$.extend(s, v);
var swfu = new SWFUpload({
flash_url: '/swf/swfupload.swf',
flash9_url: '/swf/swfupload_fp9.swf',
upload_url: s.host + '/UploadImage.aspx?Key=' + s.key + '|' + s.type,
file_types: '*.jpg;*.png;*.gif',
file_types_description: 'Image Files',
file_upload_limit: s.max,//此处重写
file_queue_limit: 0,
custom_settings: { target: c },
debug: false,
button_placeholder_id: s.button,//此处重写
button_width: 39,
button_height: 24,
button_image_url: s.imgurl,//此处重写
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
file_queued_handler: imageQueued,
file_queue_error_handler: fileQueueError,
file_dialog_complete_handler: imgDialogComplete,
upload_start_handler: uploadStart,
upload_error_handler: uploadError,
upload_success_handler: imageSuccess
});
return c;
};
2、button_height:指定Flash按钮的高度,应该为button_image_url所指定的按钮背景图片高度的1/4。
所以更换按钮背景的的图标需要是button_height设置高度的4倍。比如图片高度是80(px)的,那么初始显示的高度是background-postion:0 0;那么当鼠标移到按钮上时(onmouseover):显示图片的位置为:background-postion:0 -20px;参数参考:http://www.cnblogs.com/2050/archive/2012/08/29/2662932.html
$.fn.imgbox = function(v) {
var s = {
key: '',
url: '',
source: [],
max: 0,
type: 'default',
button: 'swfUploadImageHolder',
hdkey: '',
imgurl :'/images/upload.gif'
};
$.extend(s, v);
var swfu = new SWFUpload({
flash_url: '/swf/swfupload.swf',
flash9_url: '/swf/swfupload_fp9.swf',
upload_url: s.host + '/UploadImage.aspx?Key=' + s.key + '|' + s.type,
file_types: '*.jpg;*.png;*.gif',
file_types_description: 'Image Files',
file_upload_limit: s.max,//此处重写
file_queue_limit: 0,
custom_settings: { target: c },
debug: false,
button_placeholder_id: s.button,//此处重写
button_width: 39,
button_height: 24,
button_image_url: s.imgurl,//此处重写
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
file_queued_handler: imageQueued,
file_queue_error_handler: fileQueueError,
file_dialog_complete_handler: imgDialogComplete,
upload_start_handler: uploadStart,
upload_error_handler: uploadError,
upload_success_handler: imageSuccess
});
return c;
};
2、button_height:指定Flash按钮的高度,应该为button_image_url所指定的按钮背景图片高度的1/4。
所以更换按钮背景的的图标需要是button_height设置高度的4倍。比如图片高度是80(px)的,那么初始显示的高度是background-postion:0 0;那么当鼠标移到按钮上时(onmouseover):显示图片的位置为:background-postion:0 -20px;参数参考:http://www.cnblogs.com/2050/archive/2012/08/29/2662932.html
相关文章推荐
- Flash上传控件Swfupload php文件上传配置使用实例
- 解决使用FireFox下Flash上传文件时SESSION丢失的问题(swfupload)
- 使用swfupload上传超过30M文件,使用FLASH上传组件
- 使用swfupload上传超过30M文件,使用FLASH上传组件
- Flash图片上传组件 swfupload使用指南
- 文件上传利器SWFUpload使用指南
- Struts2使用FlashFileUpload.swf实现批量文件上传
- [转] Flash中使用Filereference上传文件的一些注意事项
- 使用SWFUpload插件上传文件
- 文件上传利器SWFUpload使用指南
- ASP.NET中如何使用SWFUpload上传文件
- 文件上传利器SWFUpload使用指南
- 使用SWFUpload上传文件
- 文件上传利器SWFUpload使用指南
- 使用swfUpload实现现文件上传
- [导入]使用Flash打造可定义界面风格的文件上传控件
- 使用SWFUpload上传文件
- 基于jquery+flash的文件上传组件uploadify使用
- 使用Kindeditor的多文件(图片)上传时出现上传失败的解决办法/使用Flash上传多文件(图片)上传时上传失败的解决办法
- 文件上传利器SWFUpload使用指南