在网上找到了图片上传插件jquery.min.js,但没有上传功能,自己花了10分钟给加上去了哈,如有bug请在素材火网页内留言,一般当天改完上传。
页面底部有演示、免费下载链接。若是想看更多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元

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

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.

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software