This article mainly introduces how jQuery + HTML5 achieves the preview effect before uploading images. It involves jquery operations on the Dynamic Display Effect of images, which is very simple and practical, for more information about how to preview images before uploading, see the example in this article. Share it with you for your reference. The details are as follows:
Here, we mainly use the HTML5 File API to create a url that can be accessed to the file, an empty img tag with the ID of img0, and display the selected File in the img tag, this feature allows you to preview images. Select a browser that supports HTML APIs, such as Google Chrome and Firefox.
Shows the running effect:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/jquery-html5-pic-upload-pre-view-codes/
The Code is as follows:
HTML5 upload image Preview