search
Homephp教程php手册PHP+jQuery+html5实现图片选取裁剪上传(兼容手机上传)

在网上找到了图片上传插件jquery.min.js,但没有上传功能,自己花了10分钟给加上去了哈,如有bug请在素材火网页内留言,一般当天改完上传。
PHP+jQuery+html5实现图片选取裁剪上传(兼容手机上传)

页面底部有演示、免费下载链接。若是想看更多js特效网站源码js教程请访问【素材火】 http://www.sucaihuo.com/js 还有演示DEMO,最主要是可以免费下载。1、<br> HTML<br> 首先我们放置一个上传按钮及相关预览信息等。<br> <form>  <br>    <!-- hidden crop params -->  <br>    <input>  <br>    <input>  <br>    <input>  <br>    <input>  <br>    <input>  <br>    <div> <br>     注意:上传前,先截图 <br>    </div>  <br>    <div>  <br>     <img src="/static/imghwm/default1.png" data-src="jquery.js" class="lazy" alt="PHP+jQuery+html5实现图片选取裁剪上传(兼容手机上传)" >  <br>     <div>  <br>      <ul>  <br>       <li> <label>文件大小</label> <input> </li>  <br>       <li> <label>类型</label> <input> </li>  <br>       <li> <label>图像尺寸</label> <input> </li>  <br>       <li> <label>宽度</label> <input> </li>  <br>       <li> <label>高度</label> <input> </li>  <br>      </ul>  <br>     </div>  <br>     <input>  <br>    </div>  <br> </form> <br> 2、<br> 接着我们引用jQuery库和Jcrop插件。<br> <link> <br> <script></script>  <br> <script></script><br> 3、<br> jQuery<br> 接着我们看下表单的检查:<br> function checkForm() { <br>     if (parseInt($('#w').val())) //若是没有截屏 <br>         return true; <br>     $('.error').html('请先选择图片,并且截图').show(); <br>     return false; <br> }<br> 4、<br> 上传文件条件设置:<br> var rFilter = /^(image\/jpeg|image\/png|image\/jpg)$/i; <br> if (!rFilter.test(oFile.type)) { <br>     $('.error').html('请选择jpg、jpeg或png格式的图片').show(); <br>     return; <br> } <br>  <br> // check for file size <br> if (oFile.size > 1000 * 1024) { <br>     $('.error').html('请上传小于1M的图片').show(); <br>     return; <br> }查看该特效演示及免费下载,请访问【素材火】:http://www.sucaihuo.com/js/71.html

AD:真正免费,域名+虚机+企业邮箱=0元

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment