swfupload プラグイン (http://demo.swfupload.org/Documentation/) を使用して複数のファイルをアップロードしています。次の swfupload 設定オブジェクトが定義されています。カーソルが「手の」形に変わらないことを除いて、すべてが正常に機能しています。コードは次のとおりです。
var initialize_swfupload_for_image = function () {
if ($('#image-attach').length == 0){
return;
}
var url = $('#image-attach').data('url');
var params = $('#image-attach').data('params');
var buttonStyle = '.image-link {color: #FFF' +
';text-align: center'+
';} ' +
'.image-link:hover {color: #0FF' +
';} ';
var settings = {
upload_url:url,
flash_url: "<%= asset_path('swfupload/swfupload.swf') %>",
flash9_url: "<%= asset_path('swfupload/swfupload_fp9.swf') %>",
http_success:[ 200, 201, 204 ],
file_post_name:"file",
file_types: "*.jpg; *.gif; *.png; *.jpeg",
file_upload_limit:1,
file_queue_limit:0,
file_size_limit:"10 MB",
prevent_swf_caching:false,
custom_settings:{
progressTarget:"divImageProgressContainer",
cancelButtonId:"btnImageCancel"
},
button_placeholder_id:"image-attach",
button_text: "<span class='image-link'>Edit Photo</span>",
button_text_style: buttonStyle,
button_width: 90,
button_height: 20,
button_cursor:SWFUpload.CURSOR.HAND,
button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,
button_action:SWFUpload.BUTTON_ACTION.SELECT_FILE,
file_queued_handler:fileQueued,
file_queue_error_handler:fileQueueError,
file_dialog_complete_handler:fileDialogComplete,
upload_start_handler:uploadStartImage,
upload_error_handler:uploadError,
upload_progress_handler:uploadProgressImage,
upload_success_handler:uploadSuccessImage,
upload_complete_handler:uploadCompleteImage,
queue_complete_handler:uploadCompleteImage,
post_params:params
};
if (FlashDetect.versionAtLeast(9)) {
swf_image = new SWFUpload(settings);
} else {
//intentionally left blank
//TODO: javascript fallback when swfupload doesn't work
}
オブジェクトの上にカーソルを置いてもカーソルが変化しない理由についての洞察は非常に役立ちます。