jQuery不同文件类型添加(原创)
jquery.upload.js是文件添加插件,可实现图片、视频以及其他类型文件的添加,添加后提交到文件上传的控制器就可以实际文件上传<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery文件添加</title>
<meta name="viewport"
content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.8, user-scalable=yes" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://www.jq22.com/demo/jqueryUpload2202303052222/css/reset.css" />
</head>
<style>
form {
width: 100%;
margin-top: 8px;
padding: 8px;
border: 2px groove #00953B;
border-radius: 8px;
}
.item {
margin: 8px;
}
textarea {
width: 100%;
height: 60px;
white-space: pre-line;
border: 2px groove #E9E9E9;
border-radius: 5px;
}
textarea:focus {
border: 2px solid #00953B;
}
input {
display: table;
margin: auto;
padding: 5px;
border: 2px groove #E9E9E9;
border-radius: 5px;
cursor: pointer;
}
.radio-lable {
font-weight: 600;
box-shadow: 5px 5px #E9E9E9;
border-radius: 3px;
}
</style>
<body>
<form enctype="multipart/form-data" id="record-form">
<ul>
<li class="item" id="call-screenshot">
<label>上传图片</label>
<div class="addImage"></div>
</li>
<li class="item" id="site-video">
<label>上传视频</label>
<div class="addVideo"></div>
</li>
<li class="item" id="call-recording">
<label>上传其他类型文件</label>
<div class="addAudio"></div>
</li>
</ul>
<input type="button" id="submit" value="提交" />
</form>
</body>
<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="https://www.jq22.com/demo/jqueryUpload2202303052222/js/jquery.upload.js"></script>
<script type="text/javascript" src="https://www.jq22.com/demo/jqueryUpload2202303052222/js/record.js"></script>
</html>
页:
[1]