jsp页面中:
上传预览图片:<br>
<input type="file"/>
<br />
<div style="overflow: hidden;">
<div id="imgDiv">
</div>
</div>
<input type="submit">
$(document).ready(function() {
//建议在#imgDiv的父元素上加个overflow:hidden;的css样式
$("input").uploadPreview({ width: 80, height: 80, imgDiv: "#imgDiv", imgType: ["bmp", "gif", "png", "jpg"] });
});
导入一个uploadPreview.js
- uploadPreview.rar (1.4 KB)
- 下载次数: 51