js 编写插件 (上传图片)

2018-10-22  本文已影响0人  _嘿嘿_

upload.js
/**

})(window.jQuery);

2.初始化
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style type="text/css">

</style>
<script src="jquery.js"></script>
<script src="upload.js"></script>
<body>
<div id="drop_area" class="aaa"></div>

</body>
<script type="text/javascript">
var dragImgUpload =$("#drop_area").dragImgUpload({
callback:function (files) {
//回调函数,可以传递给后台等等
var file = files[0];
console.log(file.name);
}
})
console.log(dragImgUpload);
</script>
</html>

上一篇下一篇

猜你喜欢

热点阅读