手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

jQuery拖拽批量上传文件插件

时间:2024-11-02 06:50:46

1、新建html文档。

jQuery拖拽批量上传文件插件

2、书写hmtl代艨位雅剖码。<section role="main" class=&鳎溻趄酃quot;l-main" style="margin-top:50px;margin-bottom:50px;"> <header class="site-header"> <h1 class="site-title l-site-title" style="font-size:1.2em;">jQuery拖拽批量上传文件插件</h1> </header> <div class="uploader__box js-uploader__box l-center-box"> <form action="#" method="POST"> <div class="uploader__contents"> <label class="button button--secondary" for="fileinput">请选择文件</label> <input id="fileinput" class="uploader__file-input" type="file" multiple value="Select Files"> </div> <input class="button button--big-bottom" type="submit" value="Upload Selected Files"> </form> </div></section>

jQuery拖拽批量上传文件插件

3、书写css代码。body, html { font-size: 100%; padding: 0; margin: 0; }*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }.clearfix:before, .clearfix:after { content: " "; display: table; }.clearfix:after { clear: both; }body { font-weight: 500; font-size: 1.05em; font-family: "Microsoft YaHei", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif; }

jQuery拖拽批量上传文件插件

4、书写并添加js代码。<script src="js/jquery-1.11.0.min.js"></script><s艘早祓胂cript src="dist/jquery.imageuploader.js"></script><script>(function(){ var options = {}; $('.js-uploader__box').uploader({ 'selectButtonCopy':'请选择或拖拽文件', 'instructionsCopy':'你可以选择或拖拽多个文件', 'submitButtonCopy':'上传选择的文件', 'furtherInstructionsCopy':'你可以选择或拖拽更多的文件', 'secondarySelectButtonCopy':'选择更多的文件', });}());</script>

jQuery拖拽批量上传文件插件

5、代码整体结构。

jQuery拖拽批量上传文件插件

6、查看效果。

jQuery拖拽批量上传文件插件
© 手抄报圈