最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to configure DropZone to hide file information - Stack Overflow

programmeradmin1浏览0评论

I am not creating a Dropzone form, but a div and then i configure it using JavaScript and Jquery.

Anyone can explain me how do i configure my DropZone to hide the files information, name and size?

I am not creating a Dropzone form, but a div and then i configure it using JavaScript and Jquery.

Anyone can explain me how do i configure my DropZone to hide the files information, name and size?

Share Improve this question edited Dec 14, 2017 at 14:47 Saqib Omer 5,4777 gold badges53 silver badges73 bronze badges asked Dec 14, 2017 at 13:38 onii-chanonii-chan 152 silver badges6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

From the docs:

The HTML that is generated for each file by dropzone is defined with the option previewTemplate which defaults to this:

<div class="dz-preview dz-file-preview">
  <div class="dz-details">
    <div class="dz-filename"><span data-dz-name></span></div>
    <div class="dz-size" data-dz-size></div>
    <img data-dz-thumbnail />
  </div>
  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
  <div class="dz-success-mark"><span>✔</span></div>
  <div class="dz-error-mark"><span>✘</span></div>
  <div class="dz-error-message"><span data-dz-errormessage></span></div>
</div>

Just set the previewTemplate option to the above HTML but with .dz-filename and .dz-size elements removed.

The template you want is probably:

<div class="dz-preview dz-file-preview">
  <div class="dz-details">
    <img data-dz-thumbnail />
  </div>
  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
  <div class="dz-success-mark"><span>✔</span></div>
  <div class="dz-error-mark"><span>✘</span></div>
  <div class="dz-error-message"><span data-dz-errormessage></span></div>
</div>
发布评论

评论列表(0)

  1. 暂无评论