简体   繁体   中英

Add preview image wrappers before upload in dropzone.js

Is it possible to set the image preview wrappers before the upload as exmaple( https://snag.gy/cgvsUL.jpg ), and after choosing the files fill the wrappers with the dropzone preview template?

There is event on "addedfile" but it fires after the file added. Is there something like "beforeaddefile" to queue, so I could catch where to put the uploaded files?

The addedfile is fired just before the file is added into the preview container. You can implement this event to do what you are trying to achieve.

this.on("addedfile", function (file) {
    file.previewElement.....("do your stuff");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM