Dropify 是一个可以自定义 HTML 输入文件风格的 jQuery 插件。
示例代码:
$('.dropify').dropify({ tpl: { wrap: '<div class="dropify-wrapper"></div>', message: '<div class="dropify-message"><span class="file-icon" /> <p>{{ default }}</p></div>', preview: '<div class="dropify-preview"><span class="dropify-render"></span><div class="dropify-infos"><div class="dropify-infos-inner"><p class="dropify-infos-message">{{ replace }}</p></div></div></div>', filename: '<p class="dropify-filename"><span class="file-icon"></span> <span class="dropify-filename-inner"></span></p>', clearButton: '<button type="button" class="dropify-clear">{{ remove }}</button>', error: '<p class="dropify-error">{{ error }}</p>' } }