Home > Web Front-end > JS Tutorial > body text

jQuery+HTML5实现图片上传前预览效果_jquery

WBOY
Release: 2016-05-16 15:43:53
Original
1860 people have browsed it

本文实例讲述了jQuery+HTML5实现图片上传前预览效果。分享给大家供大家参考。具体如下:

这里主要是使用HTML5 的File API,建立一個可存取到该file的url,一个空的img标签,ID为img0,把选择的文件显示在img标签中,实现图片预览功能。请选择支持HTML API的浏览器,比如谷歌Chrome和火狐等。

运行效果如下图所示:

在线演示地址如下:

http://demo.jb51.net/js/2015/jquery-html5-pic-upload-pre-view-codes/

具体代码如下:




HTML5上传图片预览




请选择图片文件:JPG/GIF


jQuery+HTML5实现图片上传前预览效果_jquery
Copy after login

希望本文所述对大家的jquery程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!