首先我们需要引入4个js包(这4个包总共106.6KB)

<script src="__STATIC__/hammer.min.js" ></script>
<script src="__STATIC__/iscroll-zoom.min.js"></script>
<script src="__STATIC__/lrz.all.bundle.js" ></script>
<script src="__STATIC__/PhotoClip.min.js"></script>

html:

<!--上传图片功能-->
<div id="src_0" class="weui_uploader_input_wrp">
<input type="file" id="file" class="upload_img_btn">
</div>
<!--预览图片功能-->
<li hidden class="weui_uploader_file upload_img_box_file" id="view" data-id=""><span class="del">×</span></li>
<!--剪裁图片功能-->
<div class="upload_img_box" id="upload_img_box">
<div class="pic middle" id="clipArea"></div>
<button type="submit" class="weui_btn vote_detail_btn btn" id="clipBtn">裁剪</button>
</div>

css:

.upload_img_box {width: %;min-width: 320px;max-width: 640px;background: #fff;position: fixed;top: ;bottom: ;left: ;right: ;z-index: ;display: none;}
.upload_img_box .pic {width: %;position: absolute;top: ;bottom: .05rem;left: ;}
.middle {width: %;display: flex;display: -webkit-box;display: -moz-box;-webkit-box-pack: center;-moz-box-pack: center;-webkit-box-align: center;-moz-box-align: center;}
.upload_img_box .btn {width: %;height: .65rem;background: #f8a513;color: #fff;position: absolute;bottom: .2rem;left: ;right: ;margin: auto;}
button.weui_btn, input.weui_btn {width: %;border-width: ;outline: ;}
.uploadify-button, input[type=file] {background: #33ab07;border-radius: 3px;padding: 10px ;display: block;width: %;text-align: center;color: #fff;font-size: 16px;text-decoration: none;border: none;}
.upload_img_btn {position: absolute;top: ;bottom: ;left: ;right: ;opacity: ;z-index: ;}
.weui_uploader_input_wrp {position: relative;margin-left: .34rem;height: .2rem;width: .9rem;border: 1px solid #D9D9D9;}
.weui_uploader_file {position: relative;margin-left: .34rem;height: .2rem;width: .9rem;background: center center no-repeat;background-size: cover;border: 1px solid #D9D9D9;}
.weui_uploader_file .del {width: .2rem;height: .2rem;border-radius: %;background: rgba(,,,.);font-size: .22rem;color: #fff;text-align: center;line-height: .2rem;position: absolute;top: -.1rem;right: -.1rem;}

上传图片(photoClip)的更多相关文章

  1. jquery photoClip支持手机端,PC端 本地裁剪图片后上传插件

    支持手机,PC最好的是jquery photoClip插件,下载地址&示例:https://github.com/topoadmin/photoClip demo.html 代码: <! ...

  2. 图片裁剪上传插件——jquery.photoClip.js

    想要裁剪图片上传: 需要依赖的的插件为: [jquery.photoClip.js] 插件[iscroll-zoom.js] 插件[hammer.js] 插件 [lrz.all.bundle.js] ...

  3. js插件---图片裁剪photoClip

    js插件---图片裁剪photoClip 一.总结 一句话总结:页面裁剪图片得到base64格式的图片数据,然后把这个数据通过ajax上传给服务器,服务器将base64图片数据解析成图片并且保存到服务 ...

  4. mui H5+ 调取 相册 拍照 功能 上传图片 + 裁剪功能

    H5+ 相册拍照图片上传 点击用户头像后,弹出actionSheet,选择从相册或是拍照:选取照片后调用上传方法: 上传图片后调用PhotoClip.js  插件进行裁剪 具体流程 弹出actionS ...

  5. 博客使用BOS上传图片

    1.博客平台的选定 从大学开始做个人主页算起,最开始是使用html,CSSS写简单的页面,后面大学毕业之后接触到了WordPress,就开始用WordPress搭建网站.现在还维护着一个农村网站.ht ...

  6. nodejs利用ajax实现网页无刷新上传图片

    nodejs利用ajax实现网页无刷新上传图片 标签(空格分隔): nodejs 通常情况下上传图片是要通过提交form表单来实现的,但是这又不可避免的产生了网页转. 利用ajax技术和FormDat ...

  7. -Android -线程池 批量上传图片 -附php接收代码

    (出处:http://www.cnblogs.com/linguanh/) 目录: 1,前序 2,类特点 3,用法 4,java代码 5,php代码 1,前序 还是源于重构,看着之前为赶时间写着的碎片 ...

  8. iOS 原生HTTP POST请求上传图片

    今天项目里做一个上传图片等个人信息的时候,使用了第三方AFNetworking - (AFHTTPRequestOperation *)POST:(NSString *)URLString param ...

  9. 大朋展翅 html5上传图片(三)一解决部分手机拍相册批量上传图片转向问题

    在经过前面的改进之后本来以为已经没有问题了,但经过我们神通广大的测试的测试,发现相册中的图片在上传时也会发生转向问题.既然前面都解决了拍照转向的问题,那么相册中图片的上传也容易解决.修改一下需要旋转图 ...

随机推荐

  1. 【算法】LeetCode算法题-Maximum Subarray

    这是悦乐书的第154次更新,第156篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第13题(顺位题号是53).给定一个整数数组nums,找出一个最大和,此和是由数组中索引 ...

  2. UUID生成随机字符串

    import java.util.UUID; UUID.randomUUID().toString().replace("-", "") 生成的样子      ...

  3. Vue编写的todolist小例子

    Vue编写的todolist小例子 本篇博客主要包含一个内容: 1.第一个内容:使用Vue编写todolist例子,包含的主要知识是v-model,v-for,el表达式,以及Vue中使用method ...

  4. Nmap参考指南(Man Page)

    Table of Contents 描述 译注 选项概要 目标说明 主机发现 端口扫描基础 端口扫描技术 端口说明和扫描顺序 服务和版本探测 操作系统探测 时间和性能 防火墙/IDS躲避和哄骗 输出 ...

  5. gear gym 思维题

    题目:https://vj.69fa.cn/1fc993e7e0e1e6fa7ce4640b8d46ef8d?v=1552762626 这个题目,之前有一点思路,但是呢,后来又不知道怎么去执行,然后就 ...

  6. linux学习笔记整理(五)

    第六章 Centos7用户管理本节所讲内容:6.1 用户和组的相关配置文件6.2 管理用户和组6.3实战:进入centos7 紧急模式恢复root密码 用户一般来说是指使用计算机的人,计算机对针使用其 ...

  7. 2.04-proxy-handler

    import urllib.request def create_proxy_handler(): url = "https://blog.csdn.net/m0_37499059/arti ...

  8. c#窗体获取系统时间、回车触发按钮事件、实现验证码功能

    1.窗体上显示时间: 1)首先新建一个Timer,命名为timer,并在属性中修改Interval为1000: 2)在需要显示时间的地方添加一个label(假设设置名称为:timerLabel): 3 ...

  9. 微信小程序接入,https服务器搭建和调试

    在进行小程序开发时候,调试时候,希望在本地搭建一个https环境. 准备条件: 1.公网主机(阿里云或者腾讯云主机) 2外网访问工具natapp 步骤: 1.在主机上安装nginx(nginx转发到n ...

  10. UVA11584-Partitioning by Palindromes(动态规划基础)

    Problem UVA11584-Partitioning by Palindromes Accept: 1326  Submit: 7151Time Limit: 3000 mSec Problem ...