2017-09-03 1444 0

html部分: <div id="upload-box" class="jumbotron" style="text-align: center;border: 2px dashed #ff9163;"> <h2>将文件拖动到此处上传</h2></div> JavaScript部分 <script>$(function(){ var box = document.getElementById("upload-box"); $(document).on({ dragenter: function(e){ e.stopPropagation(); e.preventDefault(); }, dragover: function(e){ e.stopPropagation(); e.preventDefault();