gpt4 book ai didi

javascript - FineUploader 按钮文本

转载 作者:行者123 更新时间:2023-11-28 11:13:07 26 4
gpt4 key购买 nike

我已经浏览了 FineUploader 文档,但是当我像下面这样设置上传按钮文本时,更改似乎没有传播。上传按钮仍显示默认文本。我错过了什么?

var manualuploader = new qq.FileUploader({
element: document.getElementById('manual-fine-uploader'),
text: {
uploadButton: "Select a File" // <========== Setting text here
},
action: "/file/upload",
autoUpload: false,
multiple: false,
forceMultipart: true,
onComplete: function (id, fileName, json) {

$("#divFileUploadLoading").hide();
$("#buttonUploadFile").show();

if (json.success) {

displaySuccessMessage("Successfully uploaded: " + fileName);

$("#textFileTitle").val("");
$("#textFileDescription").val("");
$("#checkIsDownloadable").prop("checked", true);
$("#checkDisplayDetails").prop("checked", true);
}
else {

displayErrorMessage("Failed to upload: " + fileName + " because '" + json.errorMessage + "'");
}

g_FileCount = 0;

manualuploader.clearStoredFiles();
manualuploader.reset();
},
onSubmit: function (id, fileName) {

g_FileCount++;
},
onCancel: function (id, fileName) {

$("#divFileUploadLoading").hide();
$("#buttonUploadFile").show();

displaySuccessMessage("Canceled upload for: " + fileName);

g_FileCount--;
}
});

最佳答案

经过测试和验证。您仍然需要使用“文本”选项。

text: {
uploadButton:'<div>Select a file</div>'
}

另一种方法是使用“button:”选项创建您自己的按钮。

JS:

button: document.getElementById('my-button')

HTML:

<div id="my-button" class="qq-upload-button">Select a file</div>

关于javascript - FineUploader 按钮文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15476464/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com