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拖拽批量上传文件插件
  • 文件怎样拖拽上传
  • jQuery拖拽排序布局插件
  • jquery实现传统拖拽
  • jquery插件怎么用
  • jQuery实现表格宽度自动拖拽
  • 热门搜索
    香格里拉旅游地图 始兴旅游景点大全 德国旅游必去的地方 广东惠州旅游景点 房山旅游景点 黄山旅游线路图 圣泉山旅游风景区 旅游资料 香港旅游全攻略 湖北有什么旅游景点