showing results for - "how to show multiple image preview in jquery"
Aitana
13 Sep 2017
1function previewImages() {
2
3  var preview = document.querySelector('#preview');
4  
5  if (this.files) {
6    [].forEach.call(this.files, readAndPreview);
7  }
8
9  function readAndPreview(file) {
10
11    // Make sure `file.name` matches our extensions criteria
12    if (!/\.(jpe?g|png|gif)$/i.test(file.name)) {
13      return alert(file.name + " is not an image");
14    } // else...
15    
16    var reader = new FileReader();
17    
18    reader.addEventListener("load", function() {
19      var image = new Image();
20      image.height = 100;
21      image.title  = file.name;
22      image.src    = this.result;
23      preview.appendChild(image);
24    });
25    
26    reader.readAsDataURL(file);
27    
28  }
29
30}
31
32document.querySelector('#file-input').addEventListener("change", previewImages);
Anael
13 Jun 2018
1<input id="file-input" type="file" multiple>
2<div id="preview"></div>
queries leading to this page
multiple image upload and previewupload multiple images and view as gallery in html preview multiple image before upload jquery mediumpreview 26 uplod multiple images html jqueryjquery multiple image upload with previewmultiple images edit display jqueryhow to show one image in two places in jquerymultiple image file with preview jquery pluginproduct multiple image preview in jqueryhow to multiple image preview in jqueryhow to show multiple image in preview via jqueryview more images jqueryupload multiple images with preview jqueryadd multiple immage jquerymultiple image upload and preview in jquerypreview multiple images before upload javascriptmultiple image preview in jquerymultiple image preview before upload jquery demoadd 26 preview multiple images jquery html 26 cssselect multiple image and display jquerymultiple image preview using jqueryjquery preview multiple image before uploaddisplay multiple image preview before uploading jqueryjquery multiple image upload with preview pluginjquery preview of multiple images htmlpreview multiple phtos with jqueryhow to display multiple images in jquerymultiple image upload with preview jqueryimage preview for multiple images using ajaxshow multiple image preview before upload using jqueryjquery multiple imagesmultiple images jqueryjquery multiple preview imagesmulti image uploader with previewshow multiple image preview before upload jqueryupload multiple image in html and displayhow to show multiple image preview in jqueryjquery upload multiple images with previewmultiple image preview jqueryshow multiple selected image preview in jqueryjquery upload multiple image previewpreview image from multiple input jquerypreview multiple image before upload jqueryjquery upload multiple images with preview example codehow to add multiple images using jqueryjavascript preview multiple image selected on loacslhow to upload multiple images in jquerymultiple photos preview uaing jquerymultiple selected image preview in jqueryjquery multiple preview images frm urlmultiple photo files select preview in jquerymultiple photo upload preview in jqueryhow to show multiple image preview in jquery