如何更改dropzone.js中的默认文本? [英] How do I change the default text in dropzone.js?
本文介绍了如何更改dropzone.js中的默认文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 dropzone.js 上传文件。但是,我在更改默认文本时遇到了困难。
I am using dropzone.js to upload files. However, I'm having difficulty changing the default text.
我尝试过实例化dropzone类:
I've tried instantiating the dropzone class:
$(document).ready(function(){
$(".foo").dropzone({ dictDefaultMessage: "hello" });
});
使用此标记:
<div class="span4">
<form action="http://localhost/post" method="post" accept-charset="utf-8" id="drop3" class="foo" enctype="multipart/form-data"> </form>
</div>
<div class="span4">
<form action="http://localhost/post" method="post" accept-charset="utf-8" id="drop4" class="foo" enctype="multipart/form-data"> </form>
</div>
这当然使我能够上传文件,但默认文本为空白。
This certainly gives me the ability to upload files but the default text is blank.
我测试了以下内容:
$(".foo").dropzone();
我似乎得到了相同的结果 - 没有默认文本。那么..如何更改默认文本?
and I appear to get the same result - no default text. So.. how do I change the default text?
推荐答案
在dropzone表单中添加一个元素,如下所示:
Add an element within your dropzone form as follows:
<div class="dz-message" data-dz-message><span>Your Custom Message</span></div>
这篇关于如何更改dropzone.js中的默认文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文