前端H5实现js压缩图片预览上传

该博客介绍了一种使用H5在前端实现图片压缩和预览的方法,通过JavaScript处理图片,确保图片格式为png/jpg/jpeg,并提供了一个上传照片的交互界面,包括图片选择、预览和上传功能。
摘要由CSDN通过智能技术生成

前端H5实现js压缩图片预览上传

<%@page import="tms.dto.LoginProfile"%>
<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="webTag" uri="/smartweb-tags"%>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<meta name="viewport"
content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<title>上传照片 </title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
}
.id_img_wp {
width: 94%;
margin: 0 auto;
min-height: 30px;
}
.cancel {
width: 50px;
height: 50px;
color: #989898;
position: absolute;
}

.save_btn {
margin: 20px auto;
border: none;
height: 40px;
width: 95%;
background: #ce1b1b !important;
border-radius: 3px !important;
font-family: "微软雅黑";
font-size: 16px;
color: white;
line-height: 40px;
}
.more_btn {
height: 140px;
width: 100px;
background: green;
border-radius: 3px !important;
font-family: "微软雅黑";
font-size: 16px;
color: white;
}

.info_list {
width: 100%;
height: 50px;
border-bottom:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值